-
-
Save superphly/3727f5f1a7223ac5dcd72d6fe1d03f5e to your computer and use it in GitHub Desktop.
string lenght
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Extrae (string lin) { | |
string aux; | |
int cont; // this is setup to be a counting variable | |
aux = ""; | |
cont = 0; | |
while ((lin.Substring(cont, 1) != ",") && (cont < lin.Length)) { // basically checking the lengh minus any commas | |
aux = aux + lin.Substring(cont, 1); // I'm guessing the aux is new string minus any commas? | |
cont++; // increase the cont var by 1, then loop. | |
} | |
valorX = double.Parse(aux); // just parsing the aux var | |
cont++; // Ohhhhh, I see what's going on... it's taking a string like "123,82" and parsing it into x and y coordinates. | |
aux = ""; | |
while (cont < lin.Length) { | |
aux = aux + lin.Substring(cont, 1); | |
cont++; | |
} | |
valorY = double.Parse(aux); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment