ommiting blanks in code

2 views (last 30 days)
lowcalorie
lowcalorie on 23 May 2012
how do i write a code sequence omitting any trailing and leading blanks

Answers (1)

Oleg Komarov
Oleg Komarov on 23 May 2012
Example:
str = ' some blanks here and there ';
str = strtrim(str)
str =
some blanks here and there
str([1,end])
ans =
se

Tags

Community Treasure Hunt

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

Start Hunting!