StringFragment
not ratedDivides string s into fragments, where cutPoints separate them, and returns fragment n, where fragment 0 is the first fragment.
Example:
StringFragment(" The JASS .Vault", 0, ". ") = "The"
StringFragment(" The JASS .Vault", 1, ". ") = "JASS"
StringFragment(" The JASS .Vault", 2, ". ") = "Vault"
StringFragment(" The JASS .Vault", 3, ". ") = ""
In this example "." and " " (space) are cutPoints.
This function loops through every character in string s. If the character isn't a cutPoint, then it is added to the buffer. If the character is a cutPoint or the end of the string is reached, and the buffer isn't empty, then the fragment counter is compared to the wanted fragment number. If they were equal then the function returns the buffer. If not the function increases the fragment counter and continues, if it hadn't reached the end of the string.
Example:
StringFragment(" The JASS .Vault", 0, ". ") = "The"
StringFragment(" The JASS .Vault", 1, ". ") = "JASS"
StringFragment(" The JASS .Vault", 2, ". ") = "Vault"
StringFragment(" The JASS .Vault", 3, ". ") = ""
In this example "." and " " (space) are cutPoints.
This function loops through every character in string s. If the character isn't a cutPoint, then it is added to the buffer. If the character is a cutPoint or the end of the string is reached, and the buffer isn't empty, then the fragment counter is compared to the wanted fragment number. If they were equal then the function returns the buffer. If not the function increases the fragment counter and continues, if it hadn't reached the end of the string.