Page 1 of 1

word wrap after every comma in a text ?

Posted: 06 Jun 2019 14:07
by joeko
hallo,
i have a text like

word word word, word word word, word word word,word word ……….

now i am Looking for a way to Format the text that after every comma a new line start like

word word word,
word word word,
word word word,

i believe i can use \\n but this doesnt work. can someone help ?
later this i want to Show this text as a message dialog

Re: word wrap after every comma in a text ?

Posted: 06 Jun 2019 16:04
by yogi108
Hi,

You can use something like this:
search for ', ' (comma and space, if no space remove it)
replace with newline '\n'
txt=replaceAll('word word word, word word word, word word word', '(?sm)(, )', '\n');
Hope it helps,
Regards

Re: word wrap after every comma in a text ?

Posted: 06 Jun 2019 19:08
by joeko
yes it helped :-)
thank you

Re: word wrap after every comma in a text ?

Posted: 06 Jun 2019 20:36
by yogi108
Welcome :D