从字符串中删除%0A [英] remove %0A from string

查看:427
本文介绍了从字符串中删除%0A的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何从这个字符串中删除%0A: - 这是回车键code,我需要从整个字符串中删除。那么,如何做到这一点?

输入: -

NA%0A%0AJKhell这是考验%0A

输出: -

NAJKhell这是测试

更新

 字符串注释= cmment_comment_edtx.getText()的toString()修剪();
查询字符串= URLEn coder.en code(评论,UTF-8);
的System.out.println(评论编辑是+查询);
query.replace($ 0A,);
字符串QUERY2 = URLEn coder.en code(查询,UTF-8);


解决方案

例如:

 公共类AP {    公共静态无效的主要(字串[] args){
        字符串文本=NA%0A%0AJKhell这是考验%0A;
        的System.out.println(text.replaceAll(%0A,));    }
}

OUT输出:
NAJKhell这是测试

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");

解决方案

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

这篇关于从字符串中删除%0A的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆