Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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);
}
Source by www.codewars.com #
 
PREVIOUS NEXT
Tagged: #Remove #letter #string
ADD COMMENT
Topic
Name
6+6 =