処理中の文字列から改行('\ n')文字を削除することは可能ですか?
例えば
'hello,
how are you,
that's nice.'
になる
'hello, how are you, that's nice'
ありがとう
処理中の文字列から改行('\ n')文字を削除することは可能ですか?
例えば
'hello,
how are you,
that's nice.'
になる
'hello, how are you, that's nice'
ありがとう
Javaに基づいているため、StringAPIのすべてのメソッドを使用できます。例えば:
String s = "hello,\nhow are you,\nthat's nice.";
s = s.replace('\n', ' ');
println(s);