Wiki内検索
ASKS メニュー
タグ
最近更新したページ
最新コメント
EntryLite by kitchenstude
EntryLite by sunhomeengla
MenuBar1 by Wendy
EntryLite by american casino
EntryLite by american casino
EntryLite by american casino
EntryLite by american casino
EntryLite by american casino
EntryLite by american casino
EntryLite by american casino

string

元ページ
http://www.livejournal.com/doc/s2/core1.class.stri...

戻る

string クラス


string クラス
文字列の一種。これは、小文字でのクラス名が表す様に、正確にはクラスではない。ちゃんとしたクラスだと引数渡しの際、参照で渡すが、string型の引数の場合は値で渡される。代わりに、この疑似クラスは便利なメソッドを提供する。また、他の疑似クラスとしてintがある。

メソッド


contains(string sub) : bool
もし文字列に $sub を含むなら true を返す

ends_with(string sub) : bool
もし文字列が $sub で終わるなら true を返す

length() : int
文字列の長さを返す

lower() : string
小文字にした文字列を返す

'''repeat(int n) : string
n 回分繰り返した文字列を返す

starts_with(string sub) : bool
もし文字列が $sub で始まるなら true を返す

'''substr(int start, int length) : string
$start から %length の長さの部分文字列を返す

upper() : string
大文字にした文字列を返す

upperfirst() : string
最初の文字をキャピタライズ(大文字にして)して返す
2006年09月13日(水) 22:26:44 Modified by gay_shinshi




スマートフォン版で見る