OpenLayers.Stringクラス
メソッド
startsWith
startsWith: function( str, sub )
指定された文字は文字列の開始かどうかチェックします。
パラメータ
- str {String}
- sub {Sring}
戻り値
{Boolean}
contains
contains: function( str, sub )
指定された文字は文字列に含んでいるかどうかチェックします。
パラメータ
- str {String}
- sub {Sring}
戻り値
{Boolean}
trim
trim: function( str )
文字列前後の空白文字を削除します。
パラメータ
- str {Sring} 対象文字列です。注:文字列自身は何にも変わりません。
戻り値
{String} 文字列前後の空白文字を削除した文字列です。
camelize
camelize: function( str )
例:“chicken-head” の変換結果は“chickenHead”、“-chicken-head”の変換結果は“ChickenHead”。
パラメータ
- str {Sring} 対象文字列です。注:文字列自身は何にも変わりません。
戻り値
{String} 変換した文字列です。
format
format: function( template, context, args )
Given a string with tokens in the form ${token}, return a string with tokens replaced with properties from the given context object. Represent a literal “${“ by doubling it, e.g. “${${“.
パラメータ
- template {String} 置換対象の文字列です。A template has the form “literal ${token}” where the token will be replaced by the value of context[“token”].
- context {Object} An optional object with properties corresponding to the tokens in the format string. If no context is sent, the window object will be used.
- args {Array} Optional arguments to pass to any functions found in the context. If a context property is a function, the token will be replaced by the return from the function called with these arguments.
戻り値
{String} 置換された文字列です。
Add a New Comment
page revision: 3, last edited: 25 Apr 2008 10:32





