@@ -1863,7 +1863,7 @@ pub fn char_range_at(s: &str, i: uint) -> CharRange {
1863
1863
return CharRange { ch : val as char , next : i} ;
1864
1864
}
1865
1865
1866
- /// Plucks the `n`th character from the beginning of a string
1866
+ /// Plucks the character starting at the `i`th byte of a string
1867
1867
pub fn char_at ( s : & str , i : uint ) -> char {
1868
1868
return char_range_at ( s, i) . ch ;
1869
1869
}
@@ -1874,11 +1874,11 @@ pub struct CharRange {
1874
1874
}
1875
1875
1876
1876
/**
1877
- * Given a byte position and a str, return the previous char and its position
1877
+ * Given a byte position and a str, return the previous char and its position.
1878
1878
*
1879
1879
* This function can be used to iterate over a unicode string in reverse.
1880
1880
*
1881
- * returns 0 for next index if called on start index 0
1881
+ * Returns 0 for next index if called on start index 0.
1882
1882
*/
1883
1883
pub fn char_range_at_reverse ( ss : & str , start : uint ) -> CharRange {
1884
1884
let mut prev = start;
@@ -1900,7 +1900,7 @@ pub fn char_range_at_reverse(ss: &str, start: uint) -> CharRange {
1900
1900
return CharRange { ch : ch, next : prev} ;
1901
1901
}
1902
1902
1903
- /// Plucks the `n`th character from the end of a string
1903
+ /// Plucks the character ending at the `i`th byte of a string
1904
1904
pub fn char_at_reverse ( s : & str , i : uint ) -> char {
1905
1905
char_range_at_reverse ( s, i) . ch
1906
1906
}
0 commit comments