📌  相关文章
📜  从java代码示例中的字符串中删除第一个和最后一个字符

📅  最后修改于: 2022-03-11 14:52:16.263000             🧑  作者: Mango

代码示例2
String roles = "[This is an example of list.toString()]";
//Below substring method will remove the first and last character of roles String
roles = roles.substring(1, roles.length()-1);
// here roles will become "This is an example of list.toString()"
System.out.println("New String: "+roles);