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

58.42% Correct | 41.58% Incorrect
Last Solution submitted on Nov 21, 2024

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers9918

Suggested Problems

More from this Author56

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!