WML String

来源:互联网 发布:nginx 负载 编辑:程序博客网 时间:2024/06/10 07:44

The String library contains functions for manipulating text.
字符串库(String library)包含了处理文本的函数。


WMLScript String Library Functions
WMLScript字符串库函数

Function
函数
Description
描述
charAt() Returns the character at a specified position
在一个指定的位置返回返回字符 compare() Compares two strings and returns a value that represents the result of the comparison
比较两个字符串并返回一个能够代表比较结果的值 elementAt() Divides a string into elements and returns a specified element
把一个字符串拆分成多个元素并返回其中一个指定的元素 elements() Returns the number of times a specified value appears in a string
返回一个指定值在一个字符串中出现的次数 find() Returns the position of a substring in a string
返回一个指定的子链(substring)在一个字符串中的位置 format() Formats a value
定义一个值的格式 insertAt() Divides a string into elements and inserts a substring at a specified index position
把一个字符串拆分成多个元素并在指定的指数(index)位置插入一个子链(substring) isEmpty() Checks whether a string is empty
检查一个字符串是否为空 length() Returns the length of a string
返回一个字符串的长度 removeAt() Divides a string into elements and removes a specified element
把一个字符串拆分成多个元素并删除指定的元素 replace() Replaces a part of a string with a new string
用一个新的字符串替代原字符串中的一部分 replaceAt() Divides a string into elements and replaces a specified element
把一个字符串拆分成多个元素并并用指定的元素替代 squeeze() Reduces all multiple spaces to single spaces in a string
把字符串内的多个空格删减为一个空格 subString() Returns a specified part of a string
返回一个字符串中的指定部分 toString() Converts a value to a string
把一个值转化为字符串形式 trim() Returns a string without leading and trailing spaces
返回一个字符串,除去开头和结尾的空格