@@ -79,7 +79,7 @@ For details of the underlying implementation, see [String Reference at MDN](http
79
79
#### ` charAt `
80
80
81
81
``` purescript
82
- charAt :: Number -> String -> Maybe Char
82
+ charAt :: Int -> String -> Maybe Char
83
83
```
84
84
85
85
Returns the character at the given index, if the index is within bounds.
@@ -104,7 +104,7 @@ Same as `fromChar`.
104
104
#### ` charCodeAt `
105
105
106
106
``` purescript
107
- charCodeAt :: Number -> String -> Maybe Number
107
+ charCodeAt :: Int -> String -> Maybe Int
108
108
```
109
109
110
110
Returns the numeric Unicode value of the character at the given index,
@@ -152,29 +152,37 @@ fromCharArray :: [Char] -> String
152
152
153
153
Converts an array of characters into a string.
154
154
155
+ #### ` contains `
156
+
157
+ ``` purescript
158
+ contains :: String -> String -> Boolean
159
+ ```
160
+
161
+ Checks whether the first string exists in the second string.
162
+
155
163
#### ` indexOf `
156
164
157
165
``` purescript
158
- indexOf :: String -> String -> Number
166
+ indexOf :: String -> String -> Maybe Int
159
167
```
160
168
161
169
Returns the index of the first occurrence of the first string in the
162
- second string. Returns ` -1 ` if there is no match.
170
+ second string. Returns ` Nothing ` if there is no match.
163
171
164
172
#### ` indexOf' `
165
173
166
174
``` purescript
167
- indexOf' :: String -> Number -> String -> Number
175
+ indexOf' :: String -> Int -> String -> Maybe Int
168
176
```
169
177
170
178
Returns the index of the first occurrence of the first string in the
171
- second string, starting at the given index. Returns ` -1 ` if there is
179
+ second string, starting at the given index. Returns ` Nothing ` if there is
172
180
no match.
173
181
174
182
#### ` lastIndexOf `
175
183
176
184
``` purescript
177
- lastIndexOf :: String -> String -> Number
185
+ lastIndexOf :: String -> String -> Maybe Int
178
186
```
179
187
180
188
Returns the index of the last occurrence of the first string in the
@@ -183,31 +191,28 @@ second string. Returns `-1` if there is no match.
183
191
#### ` lastIndexOf' `
184
192
185
193
``` purescript
186
- lastIndexOf' :: String -> Number -> String -> Number
194
+ lastIndexOf' :: String -> Int -> String -> Maybe Int
187
195
```
188
196
189
- Returns the index of the first occurrence of the last string in the
190
- second string, starting at the given index. Returns ` -1 ` if there is
197
+ Returns the index of the last occurrence of the first string in the
198
+ second string, starting at the given index. Returns ` Nothing ` if there is
191
199
no match.
192
200
193
201
#### ` length `
194
202
195
203
``` purescript
196
- length :: String -> Number
204
+ length :: String -> Int
197
205
```
198
206
199
207
Returns the number of characters the string is composed of.
200
208
201
209
#### ` localeCompare `
202
210
203
211
``` purescript
204
- localeCompare :: String -> String -> Number
212
+ localeCompare :: String -> String -> Ordering
205
213
```
206
214
207
- Locale-aware sort order comparison. Returns a negative number if the
208
- first string occurs before the second in a sort, a positive number
209
- if the first string occurs after the second, and ` 0 ` if their sort order
210
- is equal.
215
+ Locale-aware sort order comparison.
211
216
212
217
#### ` replace `
213
218
@@ -220,23 +225,23 @@ Replaces the first occurence of the first argument with the second argument.
220
225
#### ` take `
221
226
222
227
``` purescript
223
- take :: Number -> String -> String
228
+ take :: Int -> String -> String
224
229
```
225
230
226
231
Returns the first ` n ` characters of the string.
227
232
228
233
#### ` drop `
229
234
230
235
``` purescript
231
- drop :: Number -> String -> String
236
+ drop :: Int -> String -> String
232
237
```
233
238
234
239
Returns the string without the first ` n ` characters.
235
240
236
241
#### ` count `
237
242
238
243
``` purescript
239
- count :: (Char -> Boolean) -> String -> Number
244
+ count :: (Char -> Boolean) -> String -> Int
240
245
```
241
246
242
247
Returns the number of characters in the string for which the predicate holds.
@@ -413,7 +418,7 @@ See the [reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe
413
418
#### ` search `
414
419
415
420
``` purescript
416
- search :: Regex -> String -> Number
421
+ search :: Regex -> String -> Int
417
422
```
418
423
419
424
Returns the index of the first match of the ` Regex ` in the string, or
@@ -436,7 +441,7 @@ Unsafe string and character functions.
436
441
#### ` charCodeAt `
437
442
438
443
``` purescript
439
- charCodeAt :: Number -> String -> Number
444
+ charCodeAt :: Int -> String -> Int
440
445
```
441
446
442
447
Returns the numeric Unicode value of the character at the given index.
@@ -446,7 +451,7 @@ Returns the numeric Unicode value of the character at the given index.
446
451
#### ` charAt `
447
452
448
453
``` purescript
449
- charAt :: Number -> String -> Char
454
+ charAt :: Int -> String -> Char
450
455
```
451
456
452
457
Returns the character at the given index.
0 commit comments