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
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License