How to remove substring between \n from a string in java -
I want to remove the string from the string between \ n
if it contains the "wrong "
keyword.
main string =" Hi my name is John \ nI am an architect ... \ nHello is a bad day \ n "
I want to remove "\ nHello fails \ n"
I tried string.replace
but no success ..
The strings between each "\ n" can be divided as follows
string [] line = message.split ("\ n"); // considering that the message variable contains string string msg = ""; ("FALSE") {msg = = [CNET] + "\ n" ({CNT = C; ; }} System.out.println (msg);
Comments
Post a Comment