项目中学到的

来源:互联网 发布:大型企业网络架构 编辑:程序博客网 时间:2024/04/20 11:40

int nResId = res.getIdentifier(String.format("smiley_%d", nIndex), "drawable", strPackageName);

String.format("smiley_%d", nIndex)

正则表达式:

private static Pattern mPattern = Pattern.compile("\\[([a-zA-Z0-9\\u4e00-\\u9fa5]+?)\\]");


Matcher matcher = mPattern.matcher(strMessage);