-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|151|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Snippet Home -> Variables


 
HoboBen
Created : 03 September 2010
Edited : 03 September 2010
Language : Cobra

Parse point-pair string



Using a simple parser, extract the point-pairs from a string such as:

"-850.5,75.0 958,137.5 958,-262.5 850,325 742,262.6 742,137.5"

By using a simple tokenizer/lexer, we can safely catch all errors. And it's much more readable and maintainable than an ugly brute-force method.



edit: For syntax-highlighting, see Extract Coordinates from a String

 

Comments