Python Hapus karakter pertama dan terakhir dari string
string = string[1:-1]
Annoyed Antelope
string = string[1:-1]
String str = "Hello World";
String str2 = str.substring(1,str.length());
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);
// Remove first and last letter of string
fn main() {
let text = "Hello, world";
// remove last letter
let mut text = text.split_at(text.len() - 1);
// remove first letter
text = text.0.split_at(1);
println!("{}", text.1);
}