Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

remove first and last character from string in java

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);
 
PREVIOUS NEXT
Tagged: #remove #character #string #java
ADD COMMENT
Topic
Name
6+6 =