亲测有效. String s = "hello world" ; if ( s . contains ( " " )){ System . out . println ( "有空格" ); }
亲测有效.
String s ="hello world";if (s.contains(" ")){
System.out.println("有空格");
}
亲测有效.
String s ="hello world";