没问题啊?是不是ide的问题呢?String aa = "a+'_'+b";
System.out.println(aa);==>输出:a+'_'+b

解决方案 »

  1.   

    我找到问题所在了,但不知道怎么解决:
    是在url传值中 传之前都有+号,但接到收时没有+号了,变成了空格.
      

  2.   

    是转意符的问题,比如String aa="a_\n+";
    肯定是看不到\N的
      

  3.   

    String aa = "a+'_'+b";
    System.out.println(aa);
    是可以的,实验过来
      

  4.   

    String aa = "a+\'_\'+b";
      

  5.   

    public static void main( String[] args ) throws IOException {  String aa="a+'_'+b";
    System.out.println(aa);

    输出:
    a+'_'+b
      

  6.   

    you can try this:String aa="a%2B%27_%27%2Bb";
    The better way is using URLEncode.encode() to encode your url and using URLDecode.decode() to parse it.