HOW I CAN REMOVE THE SPACE

3 views (last 30 days)
ahmad abusara
ahmad abusara on 23 Jun 2019
Answered: Walter Roberson on 23 Jun 2019
how i can remove the spacing from strings like this
i have this string ( STEP NOT OF PETS ) and i want it to be like this ( STEPNOTOFPETS )
  2 Comments
Walter Roberson
Walter Roberson on 23 Jun 2019
Character vector? Or string() object?
ahmad abusara
ahmad abusara on 23 Jun 2019
Character vector

Sign in to comment.

Answers (2)

madhan ravi
madhan ravi on 23 Jun 2019
regexprep(yourstring,' ','')
  1 Comment
madhan ravi
madhan ravi on 23 Jun 2019
Also you could use strrep() in place of regexprep().

Sign in to comment.


Walter Roberson
Walter Roberson on 23 Jun 2019
yourstring(yourstring == ' ') = '' ;

Categories

Find more on Cell Arrays in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!