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

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -