| Package | jp.nium.utils |
| Class | public final class StringUtil |
| Inheritance | StringUtil Object |
| Method | Defined By | ||
|---|---|---|---|
collectBreak(str:String, newLine:String = null):String [static]
改行コードを変換して返します。
Convert the line feed code of the specified string and returns.
| StringUtil | ||
queryToObject(query:String):Object [static]
指定されたクエリー形式のストリングを Object に変換して返します。
Convert the specified query form string to the Object and returns.
| StringUtil | ||
repeat(str:String, count:int = 0):String [static]
指定された文字列を指定された数だけリピートさせた文字列を返します。
Returns the string which repeats the specified string with specified times.
| StringUtil | ||
toProperType(str:String, priority:Boolean = true):* [static]
指定されたストリングを適切な型のオブジェクトに変換して返します。
Convert the specified string to the proper object type and returns.
| StringUtil | ||
toUpperCaseFirstLetter(str:String):String [static]
String の最初の文字を大文字にし、以降の文字を小文字に変換して返します。
Convert the first character to upper case and remain character to lower case of the specified string.
| StringUtil | ||
| collectBreak | () | method |
public static function collectBreak(str:String, newLine:String = null):String改行コードを変換して返します。 Convert the line feed code of the specified string and returns.
Parameters
str:String — 変換したい文字列です。
The string to convert.
| |
newLine:String (default = null) — 変換後の改行コードです。
The line feed code to convert to.
|
String —
変換後の文字列です。
The converted string.
|
| queryToObject | () | method |
public static function queryToObject(query:String):Object指定されたクエリー形式のストリングを Object に変換して返します。 Convert the specified query form string to the Object and returns.
Parameters
query:String — クエリー形式のストリングです。
The query form string.
|
Object —
変換後の Object です。
The converted Object.
|
var o:Object = StringUtil.queryToObject( "a=A&b=B&c=C" );
trace( o.a ); // A
trace( o.b ); // B
trace( o.c ); // C
| repeat | () | method |
public static function repeat(str:String, count:int = 0):String指定された文字列を指定された数だけリピートさせた文字列を返します。 Returns the string which repeats the specified string with specified times.
Parameters
str:String — リピートしたい文字列です。
The string to repeat.
| |
count:int (default = 0) — リピート回数です。
Repeat time.
|
String —
リピートされた文字列です。
Repeated string.
|
trace( StringUtil.repeat( "A", 0 ) == "" ); // true
trace( StringUtil.repeat( "A", 1 ) == "A" ); // true
trace( StringUtil.repeat( "A", 2 ) == "AA" ); // true
trace( StringUtil.repeat( "ABC", 3 ) == "ABCABCABC" ); // true
| toProperType | () | method |
public static function toProperType(str:String, priority:Boolean = true):*指定されたストリングを適切な型のオブジェクトに変換して返します。 Convert the specified string to the proper object type and returns.
Parameters
str:String — 変換したいストリングです。
The string to convert.
| |
priority:Boolean (default = true) — 数値化を優先するかどうかです。
Whether it gives priority to expressing numerically or not?
|
* —
変換後のオブジェクトです。
The converted object.
|
trace( StringUtil.toProperType( "true" ) == true ); // true
trace( StringUtil.toProperType( "false" ) == false ); // true
trace( StringUtil.toProperType( "null" ) == null ); // true
trace( StringUtil.toProperType( "ABCDE" ) == "ABCDE" ); // true
trace( StringUtil.toProperType( "100" ) == 100 ); // true
trace( StringUtil.toProperType( "010" ) == 10 ); // true
trace( StringUtil.toProperType( "010", false ) == "010" ); // true
trace( StringUtil.toProperType( "10.0", false ) == "10.0" ); // true
| toUpperCaseFirstLetter | () | method |
public static function toUpperCaseFirstLetter(str:String):StringString の最初の文字を大文字にし、以降の文字を小文字に変換して返します。 Convert the first character to upper case and remain character to lower case of the specified string.
Parameters
str:String — 変換したい文字列です。
The string to convert.
|
String —
変換後の文字列です。
The converted string.
|
trace( StringUtil.toUpperCaseFirstLetter( "ABCDE" ) == "Abcde" );
trace( StringUtil.toUpperCaseFirstLetter( "abcde" ) == "Abcde" );
trace( StringUtil.toUpperCaseFirstLetter( "aBCDE" ) == "Abcde" );