How to find character bigrams from a string

Hello, I would like to find all character bigrams from a string sentence. For example night -> {ni,ig,gh,ht}. Is there a Matlab code?
Thank you very much

 Accepted Answer

str = 'night';
list = cellstr([str(1:end-1); str(2:end)].')

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!