Rename a couple of files and tweak some docs.

This commit is contained in:
Bob Nystrom
2015-01-11 19:13:15 -08:00
parent 7557c91b3c
commit bc29e0929e
6 changed files with 11 additions and 10 deletions
+6 -5
View File
@@ -244,7 +244,7 @@ It is a runtime error if `other` is not a number.
## String Class ## String Class
An object representing a string that is created via the string literal syntax. A string of Unicode code points stored in UTF-8.
### **contains**(other) ### **contains**(other)
@@ -264,8 +264,8 @@ It is a runtime error if `suffix` is not a string.
### **indexOf(search)** ### **indexOf(search)**
Returns the index of `search` in the string or -1 if `search` is not a substring Returns the index of `search` in the string or -1 if `search` is not a
of the string. substring of the string.
It is a runtime error if `search` is not a string. It is a runtime error if `search` is not a string.
@@ -291,11 +291,12 @@ Check if the string is not equal to `other`.
### **[**index**]** operator ### **[**index**]** operator
Returns a one character string of the value at `index`. This does not handle Returns a one character string of the value at `index`.
UTF-8 characters correctly.
It is a runtime error if `index` is greater than the length of the string. It is a runtime error if `index` is greater than the length of the string.
*Note: This does not currently handle UTF-8 characters correctly.*
## List Class ## List Class
**TODO** **TODO**
+1 -1
View File
@@ -955,7 +955,7 @@ DEF_NATIVE(string_indexOf)
char* firstOccurrence = strstr(string->value, search->value); char* firstOccurrence = strstr(string->value, search->value);
RETURN_NUM(firstOccurrence ? (firstOccurrence - string->value) : -1); RETURN_NUM(firstOccurrence ? firstOccurrence - string->value : -1);
} }
DEF_NATIVE(string_startsWith) DEF_NATIVE(string_startsWith)