日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Prototype 字符串

發(fā)布時(shí)間:2023/11/29 编程问答 40 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Prototype 字符串 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

2019獨(dú)角獸企業(yè)重金招聘Python工程師標(biāo)準(zhǔn)>>>

原文地址:http://www.yiibai.com/prototype/prototype_string_processing.html

Prototype 字符串處理:方法操作使用例子 - 學(xué)習(xí)如何操縱DOM和AJAX使用Prototype JavaScript框架.Prototype提高了一個(gè)有用的方法,從瑣碎的一系列復(fù)雜的String對象.

這里是所有函數(shù)列表,字符串處理的例子.

Prototype字符串方法:

注:?確保你有至少1.6版本的的prototype.js.

MethodsDescription
blank()檢查是否該字符串是“空白”,意思是空的或含有唯一的空白.
camelize()轉(zhuǎn)換成駝峰相當(dāng)于由破折號分隔的字符串。例如,'foo-bar“將被轉(zhuǎn)換為'fooBar'.
capitalize()Capitalizes the first letter of a string and downcases all the others.
dasherize()Replaces every instance of the underscore character ("_") by a dash ("-").
empty()Checks if the string is empty.
endsWith()Checks if the string ends with substring.
escapeHTML()Converts HTML special characters to their entity equivalents.
evalJSON()Evaluates the JSON in the string and returns the resulting object.
evalScripts()Evaluates the content of any script block present in the string. Returns an array containing the value returned by each script.
extractScripts()Extracts the content of any script block present in the string and returns them as an array of strings.
gsub()Returns the string with every occurrence of a given pattern replaced by either a regular string, the returned value of a function or a Template string.
include()Check if the string contains a substring.
inspect()Returns a debug-oriented version of the string.
interpolate()Treats the string as a Template and fills it with object's properties.
isJSON()Check if the string is valid JSON by the use of regular expressions. This security method is called internally.
parseQuery()Parses a URI-like query string and returns an object composed of parameter/value pairs.
scan()Allows iterating over every occurrence of the given pattern
startsWith()Checks if the string starts with substring.
strip()Strips all leading and trailing whitespace from a string.
stripScripts()Strips a string of anything that looks like an HTML script block.
stripTags()Strips a string of any HTML tag.
sub()Returns a string with the first count occurrences of pattern replaced by either a regular string, the returned value of a function or a Template string.
succ()Used internally by ObjectRange. Converts the last character of the string to the following character in the Unicode alphabet.
times()Concatenates the string count times.
toArray()Splits the string character-by-character and returns an array with the result.
toJSON()Returns a JSON string.
toQueryParams()Parses a URI-like query string and returns an object composed of parameter/value pairs.
truncate()Truncates a string to the given length and appends a suffix to it (indicating that it is only an excerpt).
underscore()Converts a camelized string into a series of words separated by an underscore ("_").
unescapeHTML()Strips tags and converts the entity forms of special HTML characters to their normal form.
unfilterJSON ()Strips comment delimiters around Ajax JSON or JavaScript responses. This security method is called internally.

轉(zhuǎn)載于:https://my.oschina.net/prototype1/blog/71347

總結(jié)

以上是生活随笔為你收集整理的Prototype 字符串的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。