#290. 字符串首尾匹配判断

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

字符串首尾匹配判断

String Start End Match

Background

In string processing exercises, we often need to check if specific parts of a string satisfy certain conditions. This is a simple problem about checking for matching characters at the beginning and end of a string.

Problem Description

Given a string, return true if the first 2 characters in the string also appear at the end of the string, such as with "edited". Otherwise, return false.

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.

Output true if the condition is met; otherwise, output false.

Sample

edited
true
edit
false
ed
true

Sample Explanation

For Sample 1 "edited\