@@ -66,7 +66,7 @@ const tag_six_b: uint = 252u;
66
66
/*
67
67
Function: is_utf8
68
68
69
- Determines if a vector uf bytes contains valid UTF-8
69
+ Determines if a vector of bytes contains valid UTF-8
70
70
*/
71
71
fn is_utf8 ( v : [ u8 ] ) -> bool {
72
72
let i = 0 u;
@@ -546,7 +546,7 @@ needle - The string to look for
546
546
547
547
Returns:
548
548
549
- The index of the first occurance of `needle`, or -1 if not found.
549
+ The index of the first occurrence of `needle`, or -1 if not found.
550
550
*/
551
551
fn find ( haystack : str , needle : str ) -> int {
552
552
let haystack_len: int = byte_len ( haystack) as int ;
@@ -723,11 +723,11 @@ fn push_bytes(&s: str, bytes: [u8]) {
723
723
/*
724
724
Function: split
725
725
726
- Split a string at each occurance of a given separator
726
+ Split a string at each occurrence of a given separator
727
727
728
728
Returns:
729
729
730
- A vector containing all the strings between each occurance of the separator
730
+ A vector containing all the strings between each occurrence of the separator
731
731
*/
732
732
fn split ( s : str , sep : u8 ) -> [ str ] {
733
733
let v: [ str ] = [ ] ;
@@ -795,7 +795,7 @@ fn to_upper(s: str) -> str {
795
795
/*
796
796
Function: replace
797
797
798
- Replace all occurances of one string with another
798
+ Replace all occurrences of one string with another
799
799
800
800
Parameters:
801
801
@@ -805,7 +805,7 @@ to - The replacement string
805
805
806
806
Returns:
807
807
808
- The original string with all occurances of `from` replaced with `to`
808
+ The original string with all occurrences of `from` replaced with `to`
809
809
*/
810
810
fn replace( s : str , from : str , to : str ) : is_not_empty ( from ) -> str {
811
811
// FIXME (694): Shouldn't have to check this
0 commit comments