How do seperate a string in different strings while not creating new strings for variables
I want to seperate a string but i dont know yet what is in the string. The only two thing I know is that if a name has a variable who look like:([XXXX]). I want to create a new string after the variable. Some variables however do not have a variable so I want to create a new string immediately after the name. Every whole string begins with a # which I dont want in my first new strings.
Deleting the # is not a problem
I tried finding the first letter of every word and checking if it is a letter with isletter. The first number shows if a word begins with a letter or something else like a bracket but after that I got stuck.
Example A.Input = '# Donald-Duck [Father] Heuy [Son] Goofy Dewey [Son] Daisy-Duck Scrooge-McDuck [Uncle]'
Wanted result: A.Output =
'Donald-Duck [Father]'
'Heuy [Son]'
'Goofy'
'Dewey [Son]'
'Daisy-Duck'
'Scrooge-McDuck [Uncle]'
If somebody could tell me how to solve this i would appreciate it
0 commentaires
Réponse acceptée
Plus de réponses (2)
0 commentaires
Voir également
Catégories
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!