vendredi 3 avril 2015

Array Randomly Splitting String C#

The string is being split using commas as delimiters. Every time string is printed, it appears in a different order. The String is variable, example below. It Successfully splits, however even if the string is exactly the same, when printing the array, we get random new lines, in random places.


This is the string... String: Z1,TA,H999.00,T999.00 When printed to Text box its either correctly split, or like: -Z1 -T -A -H999.00 -T999. -00


However, run it again through same string, and it gives the right readings, do it again, it might move a few lines around... This is the code causing the issue:



string[] ArrayCleanDataRX = CleanDataRX.Split(',');
foreach (string EntireList1 in ArrayCleanDataRX1)
{

TxtZ1.AppendText(EntireList1);
TxtZ1.AppendText("\n");
}


Any Suggestions would be brilliant. Thank you.


Aucun commentaire:

Enregistrer un commentaire