Reputation: 265
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");
Upvotes: 3
Views: 3088
Reputation: 4644
example :
public class AP {
public static void main(String[] args) {
String text = "NA%0A%0AJKhell this is test %0A";
System.out.println(text.replaceAll("%0A",""));
}
}
Out put : NAJKhell this is test
Upvotes: 3
Reputation: 30934
Try
String input = "NA%0A%0AJKhell this is test %0A";
String output = input.replaceAll("$0A","");
Upvotes: 5