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

Popular posts from this blog

python - rpy2 import is not working -

c++ - How to load a bitmap from file into the samples buffer -

javascript - How to get MySQL query result returned using $.ajax -