博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Prototype 字符串
阅读量:6251 次
发布时间:2019-06-22

本文共 2575 字,大约阅读时间需要 8 分钟。

hot3.png

原文地址:

Prototype 字符串处理:方法操作使用例子 - 学习如何操纵DOM和AJAX使用Prototype JavaScript框架.Prototype提高了一个有用的方法,从琐碎的一系列复杂的String对象.

这里是所有函数列表,字符串处理的例子.

Prototype字符串方法:

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

Methods Description
检查是否该字符串是“空白”,意思是空的或含有唯一的空白.
转换成驼峰相当于由破折号分隔的字符串。例如,'foo-bar“将被转换为'fooBar'.
Capitalizes the first letter of a string and downcases all the others.
Replaces every instance of the underscore character ("_") by a dash ("-").
Checks if the string is empty.
Checks if the string ends with substring.
Converts HTML special characters to their entity equivalents.
Evaluates the JSON in the string and returns the resulting object.
Evaluates the content of any script block present in the string. Returns an array containing the value returned by each script.
Extracts the content of any script block present in the string and returns them as an array of strings.
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.
Check if the string contains a substring.
Returns a debug-oriented version of the string.
Treats the string as a Template and fills it with object's properties.
Check if the string is valid JSON by the use of regular expressions. This security method is called internally.
Parses a URI-like query string and returns an object composed of parameter/value pairs.
Allows iterating over every occurrence of the given pattern
Checks if the string starts with substring.
Strips all leading and trailing whitespace from a string.
Strips a string of anything that looks like an HTML script block.
Strips a string of any HTML tag.
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.
Used internally by ObjectRange. Converts the last character of the string to the following character in the Unicode alphabet.
Concatenates the string count times.
Splits the string character-by-character and returns an array with the result.
Returns a JSON string.
Parses a URI-like query string and returns an object composed of parameter/value pairs.
Truncates a string to the given length and appends a suffix to it (indicating that it is only an excerpt).
Converts a camelized string into a series of words separated by an underscore ("_").
Strips tags and converts the entity forms of special HTML characters to their normal form.
Strips comment delimiters around Ajax JSON or JavaScript responses. This security method is called internally.

转载于:https://my.oschina.net/prototype1/blog/71347

你可能感兴趣的文章
WPF 在事件中绑定命令
查看>>
《工作DNA》读后感
查看>>
基于WinDbg的内存泄漏分析
查看>>
《小故事》
查看>>
气象预警采集及推送
查看>>
【SSH网上商城项目实战29】使用JsChart技术在后台显示商品销售报表
查看>>
python 基础复习 09 之基础函数
查看>>
Extjs 4
查看>>
教你使用Android SDK布局优化工具layoutopt
查看>>
Java内存模型(JMM)以及 垃圾回收机制 小结
查看>>
开源3D游戏引擎Irrlicht简介
查看>>
如何花更少的时间学习更多的知识
查看>>
学习鸟哥的Linux私房菜笔记(8)——文件查找与文件管理2
查看>>
day04 列表 增删改查 元组 range
查看>>
php 调用百度sms来发送短信的实现示例
查看>>
android 小结
查看>>
ThinkPHP5分页样式设置
查看>>
基于canvas的原生JS时钟效果
查看>>
PL/SQL查看表结构
查看>>
I2C通信时序图解析
查看>>