I'm not familiar with the regex, However I think that REGEX could help me a lot to resolve my problem.
I have 2 kind of string in a big List<string> str (with or without description) :
str[0] = "[toto]";
str[1] = "[toto] descriptionToto";
str[2] = "[titi]";
str[3] = "[titi] descriptionTiti";
str[4] = "[tata]";
str[5] = "[tata] descriptionTata";
The list isn't really ordered. I would parse all my list then format datas depending on what I will find inside.
If I find: "[toto]" I would like to get to set str[0]="toto"
and If I find "[toto] descriptionToto" I would like to get to set str[1]="descriptionToto"
Do you have any ideas of the better way to get this result please ?
[toto]to match with a[toto] descriptionToto?[toto]=>totoand[toto] description=>description