#277. 字符串去首尾
字符串去首尾
Remove First and Last Character
Background
Congcong is currently learning about string manipulation. He encountered an interesting task that requires some simple operations on strings.
Problem Description
Given a string, return a version without both the first and last character of the string. The string may be any length, including .
Input Format
Input is given from standard input in the following format.
A string .
Output Format
Output is printed to standard output in the following format.
The string after removing its first and last characters.
Sample
Hello
"ell"
abc
"b"
ab
""
Sample Explanation
- In Sample 1, the string "Hello" becomes "ell" after removing the first character 'H' and the last character 'o'.
- In Sample 2, the string "abc" becomes "b" after removing the first character 'a' and the last character 'c'.
- In Sample 3, the string "ab" becomes an empty string after removing the first character 'a' and the last character 'b'.
Constraints
Time limit: second, Memory limit: KiB for each test case.