Answers for "Remove first and last letter of string"

5

python remove first and last character from string

string = string[1:-1]
Posted by: Guest on April-22-2021
4

remove first character from string

String str = "Hello World";
String str2 = str.substring(1,str.length());
Posted by: Guest on May-05-2020
0

Remove first and last letter of string

// 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);
}
Posted by: Guest on October-13-2021

Code answers related to "Remove first and last letter of string"

Browse Popular Code Answers by Language