#268. 截取字符串前两个字符

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

截取字符串前两个字符

Extract First Two Characters

Background

Congcong is currently learning about string manipulation. He encountered an interesting task that requires extracting a part from a given string.

Problem Description

Given a string, return the string made of its first two characters. For example, the string "Hello" yields "He". If the string is shorter than length 22, return whatever there is. For example, "X" yields "X\