I am trying to save the groups in a string to an array so that I can use them in individual variables if I need to. For this I use split but for some reason I only
Just replace your line:
ultimate_array = string_final.split("#$");
with:
ultimate_array = string_final.Split(new string[] { "#$" }, StringSplitOptions.None);
I hope your problem is resolved...
The split takes an regular expression and $
is a special character (end of string) so you have to escape it with backslash \
. Anyway it is also special character, this time in Java, so you have to escape it also. The final code is:
ultimate_array = string_final.split("#\\$");
ultimate_array = string_final.split("#\\$");
The reason your split is not working correctly is that split uses regex and "$" is a special character for regexes(drekka)
You need to escape $
(end of string)
ultimate_array = string_final.split("#\\$");