Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

remove %0A from string

Tags:

java

android

how can i remove %0A from this string :- this is enter key code, which i need to remove from entire string. so how can i do this?

input:-

"NA%0A%0AJKhell this is test %0A"

Output:-

NAJKhell this is test

Update

String Comment = cmment_comment_edtx.getText().toString().trim();
String query = URLEncoder.encode(Comment, "utf-8");
System.out.println("comment edit is "+query);
query.replace("$0A", "");
String query2 = URLEncoder.encode(query, "utf-8");
like image 547
sahil Avatar asked Jun 09 '26 05:06

sahil


1 Answers

Try

String input = "NA%0A%0AJKhell this is test %0A";
String output =  input.replaceAll("$0A","");
like image 178
Heiko Rupp Avatar answered Jun 10 '26 18:06

Heiko Rupp