As shown below:
if(str.indexOf(",") >= 0) System.out.println("There is a comma in the string");The above method to determine whether a string has commas is the entire content shared by the editor. I hope it can give you a reference and I hope you can support Wulin.com more.