文字列の最初と最後の文字をつなげて返すような関数を作成しましょう。 もし文字が一つしかない場合、その文字は最初と最後の文字のため、関数はその文字を二回返すようにしておきましょう。

例:

   stringfirstandlast('boring example') = 'be'

Solution Stats

456 Solutions

343 Solvers

Last Solution submitted on Feb 01, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers343

Suggested Problems

More from this Author12

Community Treasure Hunt

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

Start Hunting!