我不断得到字符串索引,我不知道问题出在哪里
String username, userDisplayName;while (commentBody.contains("[~")) {
username = commentBody.substring(commentBody.indexOf("[~")+2, commentBody.indexOf("]"));
try {
userDisplayName = connector.getUserByUsername(username).get().getDisplayName();
commentBody = commentBody.replace("[~" + username + "]", userDisplayName);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ExecutionException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}}
慕村225694
ibeautiful
桃花长相依
随时随地看视频慕课网APP
相关分类