sahil
sahil

Reputation: 265

remove %0A from string

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

Answers (2)

asela38
asela38

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

Heiko Rupp
Heiko Rupp

Reputation: 30934

Try

String input = "NA%0A%0AJKhell this is test %0A";
String output =  input.replaceAll("$0A","");

Upvotes: 5

Related Questions