#290. 字符串首尾匹配判断
字符串首尾匹配判断
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 .
Output Format
Output is printed to Standard Output in the following format.
Output
trueif the condition is met; otherwise, outputfalse.
Sample
edited
true
edit
false
ed
true
Sample Explanation
For Sample 1 "edited\