03/10/2008import phoxer.Strings.TrimMode; TrimMode.trim(" A *ver! ?$& que 467 oNda "); //A *ver! ?$& que 467 oNda TrimMode.removeSpaces(" A *ver! ?$& que 467 oNda "); //A*ver!?$&que467oNda TrimMode.removeExtraSpaces(" w A*ver w!?$ &q ue 467 oNda w "); //w A*ver w!?$ &q ue 467 oNda w TrimMode.addSpaces(" w A*ver w!?$ &q ue 467 oNda w "); // w A * v e r w ! ? $ & q u e 4 6 7 o N d a w
/** by .:[PHOXER]:. http://www.phoxer.com v 1.0; */ package phoxer.Strings{ public class TrimMode{ public static function trim(str:String):String{ return str.replace(/^\s*(.*?)\s*$/g, "$1"); } public static function removeAllSpaces(str:String):String{ return str.replace(/\s*(.*?)/g, "$1"); } public static function removeExtraSpaces(str:String):String{ return trim(str).replace(/\s{1,}(.*?)/g, "$1 "); } public static function splitInSpaces(str:String):String{ return trim(removeAllSpaces(str).replace(/\s*(.*?)/g, " ")); } } }
| ActionScript 3 | Flex 3 | Flash CS4 | Flash CS3 |
----------------------------------------------
Si los tutoriales o los temas tratados en este blog te gustaron y quieres ayudarme a mantenerlos en linea puede hacer una donacion.
La donaciones son destinadas para mantener este blog y a los tutoriales Online.