Removes all characters from the given string whirh are NOT a number, '.' or ':'. Returns true if any change was done to the input text.
252 {
253 bool was_text_changed = false;
254 int length = potential_ip.Length();
255
256
257 for (int i = length - 1 ; i >= 0; --i)
258 {
259 string character = potential_ip.Get(i);
260
261 if (character.
ToInt() == 0 && character !=
"0" && character !=
"." && character !=
":")
262 {
263 potential_ip = potential_ip.SubstringInverted(potential_ip, i, i + 1);
264 was_text_changed = true;
265 }
266 }
267
269
270 return (was_text_changed || text_was_shortened);
271 }
proto native int ToInt()
Converts string to integer.