finding indices in a string
13 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
how can i find the indices of the leading zeros in this string: '123 0009 90'
0 Commenti
Risposte (2)
Adam
il 16 Dic 2016
idx = strfind( str, ' 0' );
will find you the start of each leading 0. Then you can count the zeros after each of those before a 'proper' number.
strsplit( str, ' ' );
will divide up your string into each component also, but getting the indices from that would be a tedious process so probably not too helpful.
0 Commenti
Vedere anche
Categorie
Scopri di più su Characters and Strings in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!