我需要从子字符串中获取字符串。
String whlval = "I have stackoverflow accounts and i use to login from different users
i.e Angel23552 wow isn't it";
所以我想从Angel找回整个值“Angel23552”,即“Angel23552”的结果
条件: -
答案 0 :(得分:1)
String[] split = StringUtils.split("I have stackoverflow accounts and i use to login from different users i.e Angel23552 wow isn't it");
然后在循环中你可以尝试使用StringUtils.contains(CharSequence seq,CharSequence searchSeq) - 返回true或false
答案 1 :(得分:0)
这样的事情对你有用吗?
String result = whlval.replaceAll(".*(Angel[^\\s]*).*","$1");