我试过 str.indexof("\★")不管用
不过如果只是判断字符串是否含有这个字符,使用:
s.contains("★");
[code="java"]String s = "ssss★";System.out.println(s.indexOf("★"));[/code]
运行结果:4