Changeset 179 for trunk/docs/api
- Timestamp:
- Apr 20, 2011, 12:16:05 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docs/api/zoo-string.txt
r157 r179 35 35 36 36 startsWith 37 :: 38 39 startsWith: function(str,sub) 40 37 41 Test whether a string starts with another string. 38 42 43 *Parameters* 44 45 | ``str {String}`` The string to test. 46 | ``sub {Sring}`` The substring to look for. 47 48 *Returns* 49 50 ``{Boolean}`` The first string starts with the second. 51 39 52 .. _contains: 40 53 41 54 contains 55 :: 56 57 contains: function(str,sub) 58 42 59 Test whether a string contains another string. 43 60 61 *Parameters* 62 63 | ``str {String}`` The string to test. 64 | ``sub {String}`` The substring to look for. 65 66 *Returns* 67 68 ``{Boolean}`` The first string contains the second. 69 44 70 .. _trim: 45 71 46 72 trim 73 :: 74 75 trim: function(str) 76 47 77 Removes leading and trailing whitespace characters from a string. 78 79 *Parameters* 80 81 ``str {String}`` The (potentially) space-padded string. This string is not modified. 82 83 *Returns* 84 85 ``{String}`` A trimmed version of the string with all leading and trailing spaces removed. 48 86 49 87 .. _camelize: 50 88 51 89 camelize 52 Camel-case a hyphenated string. 90 :: 91 92 camelize: function(str) 93 94 Camel-case a hyphenated string. Ex. "chicken-head" becomes "chickenHead", and "-chicken-head" becomes "ChickenHead". 95 96 *Parameters* 97 98 ``str {String}`` The string to be camelized. The original is not modified. 99 100 *Returns* 101 102 ``{String}`` The string, camelized 53 103 54 104 .. _tokenRegEx: 55 105 56 106 tokenRegEx 57 Used to find tokens in a string. 107 Used to find tokens in a string. Examples: *${a}, ${a.b.c}, ${a-b}, ${5}* 58 108 59 109 .. _numberRegEx: … … 65 115 66 116 isNumeric 117 :: 118 119 isNumeric: function(value) 120 67 121 Determine whether a string contains only a numeric value. 122 123 *Examples* 124 125 :: 126 127 ZOO.String.isNumeric("6.02e23") // true 128 ZOO.String.isNumeric("12 dozen") // false 129 ZOO.String.isNumeric("4") // true 130 ZOO.String.isNumeric(" 4 ") // false 131 132 *Returns* 133 134 ``{Boolean}`` String contains only a number. 68 135 69 136 .. _numericIf: 70 137 71 138 numericIf 139 :: 140 141 numericIf: function(value) 142 72 143 Converts a string that appears to be a numeric value into a number. 144 145 *Returns* 146 147 ``{Number|String}`` a Number if the passed value is a number, a String otherwise.
Note: See TracChangeset
for help on using the changeset viewer.