Cody

Problem 649. Return the first and last character of a string

Return the first and last character of a string, concatenated together. If there is only one character in the string, the function should give that character back twice since it is both the first and last character of the string.

Example:

   stringfirstandlast('boring example') = 'be'

Solution Stats

65.97% Correct | 34.03% Incorrect
Last solution submitted on Mar 26, 2019

Problem Comments

Solution Comments

Recent Solvers968

Suggested Problems

More from this Author57

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!