Referência do ActionScript® 3.0 para Adobe® Flash® Platform
Início  |  Ocultar listas de Pacotes e Classes |  Pacotes  |  Classes  |  Novidades  |  Índice  |  Apêndices  |  Por que inglês?
Filtros: Recuperando dados do servidor...
Recuperando dados do servidor...
mx.utils 

StringUtil  - AS3 Flex

Pacotemx.utils
Classepublic class StringUtil
HerançaStringUtil Inheritance Object

Versão da linguagem: ActionScript 3.0
Versão de produto: Flex 3
Versões de runtime: 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.



Propriedades públicas
 PropriedadeDefinido por
 Inheritedconstructor : Object
Uma referência ao objeto de classe ou à função de construtor de uma determinada ocorrência de objeto.
Object
Métodos públicos
 MétodoDefinido por
 Inherited
Indica se um objeto tem uma propriedade especificada definida.
Object
 Inherited
Indica se uma ocorrência da classe Object está na cadeia de protótipos do objeto especificado como o parâmetro.
Object
  
[estático] Returns true if the specified string is a single space, tab, carriage return, newline, or formfeed character.
StringUtil
 Inherited
Indica se a propriedade especificada existe e é enumerável.
Object
  
[estático] Returns a string consisting of a specified string concatenated with itself a specified number of times.
StringUtil
  
restrict(str:String, restrict:String):String
[estático] Removes "unallowed" characters from a string.
StringUtil
 Inherited
Define a disponibilidade de uma propriedade dinâmica para operações de repetição.
Object
  
[estático] Substitutes "{n}" tokens within the specified string with the respective arguments passed in.
StringUtil
 Inherited
Retorna a representação da string deste objeto, formatado segundo as convenções específicas para a localidade.
Object
 Inherited
Retorna a representação de string do objeto especificado.
Object
  
[estático] Removes all whitespace characters from the beginning and end of the specified string.
StringUtil
  
[estático] 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
Retorna o valor primitivo do objeto especificado.
Object
Detalhes do método

isWhitespace

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

Versão da linguagem: ActionScript 3.0
Versão de produto: Flex 3
Versões de runtime: 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.

Retorna
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

Versão da linguagem: ActionScript 3.0
Versão de produto: Flex 4.1
Versões de runtime: 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.

Retorna
String — The repeated string.

restrict

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

Versão da linguagem: ActionScript 3.0
Versão de produto: Flex 4.1
Versões de runtime: 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.

Retorna
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

Versão da linguagem: ActionScript 3.0
Versão de produto: Flex 3
Versões de runtime: 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";
         } 

Retorna
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

Versão da linguagem: ActionScript 3.0
Versão de produto: Flex 3
Versões de runtime: 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.

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

trimArrayElements

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

Versão da linguagem: ActionScript 3.0
Versão de produto: Flex 3
Versões de runtime: 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.

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




[ X ]Por que inglês?
O conteúdo na Referência do ActionScript 3.0 aparece em inglês

Nem todas as partes da Referência do ActionScript 3.0 estão traduzidas em todos os idiomas. Quando um elemento de um idioma não está traduzido, ele é exibido em inglês. Por exemplo, a classe ga.controls.HelpBox não está traduzida em nenhum idioma. Por isso, na versão da referência em português do Brasil, a classe ga.controls.HelpBox é exibida em inglês.