Referencia de ActionScript® 3.0 para la plataforma de Adobe® Flash®
Inicio  |  Ocultar lista de paquetes y clases |  Paquetes  |  Clases  |  Novedades  |  Índice  |  Apéndices  |  ¿Por qué hay texto en inglés?
Filtros: Recuperando datos del servidor...
Recuperando datos del servidor...
mx.utils 

StringUtil  - AS3 Flex

Paquetemx.utils
Clasepublic class StringUtil
HerenciaStringUtil Inheritance Object

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

The StringUtil utility class is an all-static class with methods for working with String objects within Flex. You do not create instances of StringUtil; instead you call methods such as the StringUtil.substitute() method.



Propiedades públicas
 PropiedadDefinido por
 Inheritedconstructor : Object
Una referencia a la clase de objeto o función constructora para una instancia de objeto determinada.
Object
Métodos públicos
 MétodoDefinido por
 Inherited
Indica si un objeto tiene definida una propiedad especificada.
Object
 Inherited
Indica si hay una instancia de la clase Object en la cadena de prototipo del objeto especificado como parámetro.
Object
  
[estática] Returns true if the specified string is a single space, tab, carriage return, newline, or formfeed character.
StringUtil
 Inherited
Indica si existe la propiedad especificada y si es enumerable.
Object
  
[estática] Returns a string consisting of a specified string concatenated with itself a specified number of times.
StringUtil
  
restrict(str:String, restrict:String):String
[estática] Removes "unallowed" characters from a string.
StringUtil
 Inherited
Establece la disponibilidad de una propiedad dinámica para operaciones de bucle.
Object
  
[estática] Substitutes "{n}" tokens within the specified string with the respective arguments passed in.
StringUtil
 Inherited
Devuelve la representación de cadena de este objeto, con formato según las convenciones específicas de configuración regional.
Object
 Inherited
Devuelve la representación de cadena del objeto especificado.
Object
  
[estática] Removes all whitespace characters from the beginning and end of the specified string.
StringUtil
  
[estática] Removes all whitespace characters from the beginning and end of each element in an Array, where the Array is stored as a String.
StringUtil
 Inherited
Devuelve el valor simple del objeto especificado.
Object
Información sobre métodos

isWhitespace

()método
public static function isWhitespace(character:String):Boolean

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Returns true if the specified string is a single space, tab, carriage return, newline, or formfeed character.

Parámetros

character:String — The String that is is being queried.

Valor devuelto
Booleantrue if the specified string is a single space, tab, carriage return, newline, or formfeed character.

repeat

()método 
public static function repeat(str:String, n:int):String

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 4.1
Versiones de motor de ejecución: Flash Player 10, AIR 1.5

Returns a string consisting of a specified string concatenated with itself a specified number of times.

Parámetros

str:String — The string to be repeated.
 
n:int — The repeat count.

Valor devuelto
String — The repeated string.

restrict

()método 
public static function restrict(str:String, restrict:String):String

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 4.1
Versiones de motor de ejecución: Flash Player 10, AIR 1.5

Removes "unallowed" characters from a string. A "restriction string" such as "A-Z0-9" is used to specify which characters are allowed. This method uses the same logic as the restrict property of TextField.

Parámetros

str:String — The input string.
 
restrict:String — The restriction string.

Valor devuelto
String — The input string, minus any characters that are not allowed by the restriction string.

substitute

()método 
public static function substitute(str:String, ... rest):String

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Substitutes "{n}" tokens within the specified string with the respective arguments passed in.

Parámetros

str:String — The string to make substitutions in. This string can contain special tokens of the form {n}, where n is a zero based index, that will be replaced with the additional parameters found at that index if specified.
 
... rest — Additional parameters that can be substituted in the str parameter at each {n} location, where n is an integer (zero based) index value into the array of values specified. If the first parameter is an array this array will be used as a parameter list. This allows reuse of this routine in other methods that want to use the ... rest signature. For example
         public function myTracer(str:String, ... rest):void
         { 
             label.text += StringUtil.substitute(str, rest) + "\n";
         } 

Valor devuelto
String — New string with all of the {n} tokens replaced with the respective arguments specified.

trim

()método 
public static function trim(str:String):String

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Removes all whitespace characters from the beginning and end of the specified string.

Parámetros

str:String — The String whose whitespace should be trimmed.

Valor devuelto
String — Updated String where whitespace was removed from the beginning and end.

trimArrayElements

()método 
public static function trimArrayElements(value:String, delimiter:String):String

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Removes all whitespace characters from the beginning and end of each element in an Array, where the Array is stored as a String.

Parámetros

value:String — The String whose whitespace should be trimmed.
 
delimiter:String — The String that delimits each Array element in the string.

Valor devuelto
String — Updated String where whitespace was removed from the beginning and end of each element.




[ X ]¿Por qué hay texto en inglés?
Cierto contenido de la Referencia de ActionScript 3.0 se muestra en inglés

No todo el contenido de la Referencia de ActionScript 3.0 se traduce a todos los idiomas. Si un elemento del lenguaje no se traduce, aparecerá en inglés. Por ejemplo, la clase ga.controls.HelpBox no está traducida en ningún idioma. Por lo tanto, en la versión en español de la referencia, la clase ga.controls.HelpBox aparecerá en inglés.