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 get the full string in the first position in the array: ultimate_array[0]. If I want to use ultimate_array[1] I get an exception like “out of bounds”.
Do you have any idea what am I doing wrong?
String string_final = "";
String[] ultimate_array = new String[100];
String sNrFact = "";
string_final="Nrfact#$idfact1#$valfact1#$idfact2#$valfact2#$idfact3#$valfact3#$idfact4#$valfact4#$idfact5#$valfact5#$idfact6#$valfact6#$idfact7#$valfact7#$idfact8#$valfact8#$idfact9#$valfact9#$idfact10#$valfact10";
ultimate_array = string_final.split("#$");
sNrFact = ultimate_array[0];
You need to escape
$(end of string)