Problem 649. Return the first and last characters of a character array
Return the first and last characters of a character array, concatenated together. If there is only one character in the character array, the function should give that character back twice since it is both the first and last character of the character array.
Example:
stringfirstandlast('boring example') = 'be'
Solution Stats
Problem Comments
-
4 Comments
Show
1 older comment
goc3
on 20 Jan 2021
The title and description have been updated, along with a few new test cases.
Bryce Lewis
on 5 May 2021
Wow this actually is such a great question
ML
on 28 Jan 2023
good problem
Solution Comments
Show commentsProblem Recent Solvers10541
Suggested Problems
-
Cell Counting: How Many Draws?
2132 Solvers
-
Simple equation: Annual salary
4203 Solvers
-
ベクトル [1 2 3 4 5 6 7 8 9 10] の作成
566 Solvers
-
2031 Solvers
-
1182 Solvers
More from this Author56
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!