HOW I CAN REMOVE THE SPACE

2 visualizzazioni (ultimi 30 giorni)
ahmad abusara
ahmad abusara il 23 Giu 2019
Risposto: Walter Roberson il 23 Giu 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 Commenti
Walter Roberson
Walter Roberson il 23 Giu 2019
Character vector? Or string() object?
ahmad abusara
ahmad abusara il 23 Giu 2019
Character vector

Accedi per commentare.

Risposte (2)

madhan ravi
madhan ravi il 23 Giu 2019
regexprep(yourstring,' ','')
  1 Commento
madhan ravi
madhan ravi il 23 Giu 2019
Also you could use strrep() in place of regexprep().

Accedi per commentare.


Walter Roberson
Walter Roberson il 23 Giu 2019
yourstring(yourstring == ' ') = '' ;

Categorie

Scopri di più su Cell Arrays in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by