Class CFW_Util_String

Description
  • author: okada

Located in /Util/String.php (line 6)


	
			
Class Constant Summary
Method Summary
static string deleteAllWhiteSpace (string $s)
static string deleteEscapeSequence (string $s)
static string deleteNewLine (string $s)
static void lowerCamel ( $s)
static string normalize (string $s, [integer $mode = self::NORMALIZE_DEFAULT])
static strign normalizeAlpha (string $s)
static string normalizeAlphaNumeric (string $s)
static string normalizeDigit (string $s)
static string normalizeNumeric (string $s)
static string normalizeString (string $s, integer $mode)
static string randomString ([integer $length = 8])
static string repeat (string $s, int $times)
static string right (string $source, string $length)
static multitype:unknown splitKeyValue (unknown_type $str, [unknown_type $separator = "="])
static string tabToWhiteSpace (string $s)
static string toNarrow (string $s)
static string toString (object $o)
static string toWide (string $s)
static string trim (string $s)
static string trimLeft (string $s)
static string trimRight (string $s)
static void upperCamel ( $s)
Methods
static method deleteAllWhiteSpace (line 93)

空白削除

全角でも半角でもスペースっぽいものは取り除く、タブ文字も追加 文字列中の空白も対象

  • return: 削除後の文字列
  • access: public
static string deleteAllWhiteSpace (string $s)
  • string $s: 元の文字列
static method deleteEscapeSequence (line 64)

(余計だと思われる)エスケープシーケンスの削除

縦タブ、EOF文字、null文字を削除する。 特にnullインジェクションを回避するためにシステム外部の入力に対して必ず通す必要がある。

  • return: 削除後の文字列
  • access: public
static string deleteEscapeSequence (string $s)
  • string $s: 対象文字列
static method deleteNewLine (line 73)

改行削除

  • return: 削除後の文字列
  • access: public
static string deleteNewLine (string $s)
  • string $s: 元の文字列
static method lowerCamel (line 278)
  • access: public
static void lowerCamel ( $s)
  • $s
static method normalize (line 202)

normalizeString

  • return: 正規化された文字列
  • access: public
static string normalize (string $s, [integer $mode = self::NORMALIZE_DEFAULT])
  • string $s: 元の文字列
  • integer $mode: 正規化モード
static method normalizeAlpha (line 176)

英数字を正規化する

すべての空白、タブ文字、全角空白を取り除く

  • return: 正規化結果
  • access: public
static strign normalizeAlpha (string $s)
  • string $s: 元の文字列
static method normalizeAlphaNumeric (line 154)

英数字を正規化する

すべての空白、タブ文字、全角空白を取り除く

  • return: 正規化結果
  • access: public
static string normalizeAlphaNumeric (string $s)
  • string $s: 元の文字列
static method normalizeDigit (line 165)

数字項目を正規化する

すべての空白、タブ文字、全角空白を取り除く

  • return: 正規化結果
  • access: public
static string normalizeDigit (string $s)
  • string $s: 元の文字列
static method normalizeNumeric (line 188)

数字項目を正規化する

すべての空白、タブ文字、全角空白を取り除く カンマを削除

  • return: 正規化結果
  • access: public
static string normalizeNumeric (string $s)
  • string $s: 元の文字列
static method normalizeString (line 251)

normalizeString

  • return: 正規化された文字列
  • access: public
static string normalizeString (string $s, integer $mode)
  • string $s: 元の文字列
  • integer $mode: 正規化モード
static method randomString (line 302)

ランダム文字列生成(簡易)

適当にランダムな文字列を生成する。 ネタ元はhttp://tipstip.com/post/32/92/

  • access: public
static string randomString ([integer $length = 8])
  • integer $length
static method repeat (line 262)

特定文字列を繰り返した文字列を返す

  • return: 文字列を指定回数繰り返した文字列
  • access: public
static string repeat (string $s, int $times)
  • string $s: 繰り返したい文字列
  • int $times: 回数
static method right (line 52)

文字列の右側指定文字数分取得

  • return: 元の文字列の右側
  • access: public
static string right (string $source, string $length)
  • string $source: 元の文字列
  • string $length: 長さ
static method splitKeyValue (line 316)

キーと値の組み合わせを記述した文字列をキーと値に分割する

  • return: "key"と"value"を要素キーに持つ配列
  • access: public
static multitype:unknown splitKeyValue (unknown_type $str, [unknown_type $separator = "="])
  • unknown_type $str
  • unknown_type $separator
static method tabToWhiteSpace (line 82)

tab -> 空白の削除

  • return: 変換後の文字列
  • access: public
static string tabToWhiteSpace (string $s)
  • string $s: 元の文字列
static method toNarrow (line 133)

全角カナ、全角英数を半角に変換

  • return: 半角変換結果
  • access: public
static string toNarrow (string $s)
  • string $s: 対象文字列
static method toString (line 30)

入力オブジェクトを文字列化

  • return: 入力オブジェクトを文字列化したもの
  • access: public
static string toString (object $o)
  • object $o: 入力オブジェクト
static method toWide (line 143)

半角カナ、半角英数を全角に変換

  • return: 全角に変換した文字列
  • access: public
static string toWide (string $s)
  • string $s: 対象文字列
static method trim (line 103)

trim()拡張

全角でも半角でもスペースっぽいものは取り除く、タブ文字も追加

  • return: 削除後の文字列
  • access: public
static string trim (string $s)
  • string $s: 元の文字列
static method trimLeft (line 114)

trim()拡張

全角でも半角でもスペースっぽいものは取り除く、タブ文字も追加

  • return: 削除後の文字列
  • access: public
static string trimLeft (string $s)
  • string $s: 元の文字列
static method trimRight (line 124)

trim()拡張

全角でも半角でもスペースっぽいものは取り除く、タブ文字も追加

  • return: 削除後の文字列
  • access: public
static string trimRight (string $s)
  • string $s: 元の文字列
static method upperCamel (line 270)
  • access: public
static void upperCamel ( $s)
  • $s
Class Constants
NORMALIZE_DEFAULT = 35 (line 24)
NORMALIZE_DELETE_ALL_WHITE_SPACE = 31 (line 15)
NORMALIZE_DELETE_SPACE = 4 (line 12)
NORMALIZE_DELETE_TAB = 16 (line 14)
NORMALIZE_DELETE_WIDE_SPACE = 8 (line 13)
NORMALIZE_NONE = 0 (line 8)
NORMALIZE_TAB_TO_SPACE = 32 (line 16)
NORMALIZE_TO_ALPHA = 512 (line 20)
NORMALIZE_TO_ALPHA_DIGIT = 1536 (line 22)
NORMALIZE_TO_DIGIT = 1024 (line 21)
NORMALIZE_TO_LOWER = 128 (line 18)
NORMALIZE_TO_NARROW = 64 (line 17)
NORMALIZE_TO_NUMERIC = 2048 (line 23)
NORMALIZE_TO_UPPER = 256 (line 19)
NORMALIZE_TRIM_ALL = 3 (line 11)
NORMALIZE_TRIM_LEFT = 1 (line 9)
NORMALIZE_TRIM_RIGHT = 2 (line 10)

Documentation generated on Fri, 25 Dec 2009 21:43:16 +0900 by phpDocumentor 1.4.3