判断字符串之间是否存在空格

String str = "ab cd";
if(str.Index.of(" ")!=-1){
  System.out.println("字符串存在空格!");
}
posted @ 2022-03-16 17:24  潜跃  阅读(326)  评论(0编辑  收藏  举报