#277. 字符串去首尾

    ID: 277 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatString-1gesp3字符串

字符串去首尾

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 00.

Input Format

Input is given from standard input in the following format.

A string SS.

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: 11 second, Memory limit: 10241024 KiB for each test case.