Packagejp.nium.utils
Classpublic final class StringUtil

StringUtil クラスは、文字列操作のためのユーティリティクラスです。 The StringUtil class is an utility class for string operation.



Public Methods
 MethodDefined by
  
clip(str:String, length:int):String
[static] ストリングが指定文字数で収まるように、前後を残して中央部分を削除します。
StringUtil
  
collectBreak(str:String, newLine:String = null):String
[static] 改行コードを変換して返します。 Convert the line feed code of the specified string and returns.
StringUtil
  
ignoreBreak(str:String):String
[static] 全ての改行コードを削除します。
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 = false):*
[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
Method detail
clip()method
public static function clip(str:String, length:int):String

ストリングが指定文字数で収まるように、前後を残して中央部分を削除します。

Parameters
str:String変換したい文字列です。 The string to convert.
 
length:int整形後の文字数です。

Returns
String変換後の文字列です。 The converted string.

Example
   

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.

Returns
String変換後の文字列です。 The converted string.

Example
   

ignoreBreak()method 
public static function ignoreBreak(str:String):String

全ての改行コードを削除します。

Parameters
str:String全ての改行コードを削除したいストリングです。

Returns
String全ての改行コードが削除された後のストリングです。

Example
   

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.

Returns
Stringリピートされた文字列です。 Repeated string.

Example
   

toProperType()method 
public static function toProperType(str:String, priority:Boolean = false):*

指定されたストリングを適切な型のオブジェクトに変換して返します。 Convert the specified string to the proper object type and returns.

Parameters
str:String変換したいストリングです。 The string to convert.
 
priority:Boolean (default = false)数値化を優先するかどうかです。 Whether it gives priority to expressing numerically or not?

Returns
*変換後のオブジェクトです。 The converted object.

Example
   

toUpperCaseFirstLetter()method 
public static function toUpperCaseFirstLetter(str:String):String

String の最初の文字を大文字にし、以降の文字を小文字に変換して返します。 Convert the first character to upper case and remain character to lower case of the specified string.

Parameters
str:String変換したい文字列です。 The string to convert.

Returns
String変換後の文字列です。 The converted string.

Example