Skip to content

Commit 0f226c2

Browse files
committed
Merge pull request #74 from Nnwww/4_17_String_fix
[Fix] 4.17. String
2 parents eb5d3c3 + f722c09 commit 0f226c2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

1.6/ja/book/strings.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,12 @@ println!("The first letter of s is {}", s[0]); // エラー!!!
138138
<!-- expensive operation, and we don’t want to be misleading. Furthermore, ‘letter’ -->
139139
<!-- isn’t something defined in Unicode, exactly. We can choose to look at a string as -->
140140
<!-- individual bytes, or as codepoints:-->
141-
普通、ベクターへの `[]` を用いたアクセスはとても高速です。
141+
普通、ベクタへの `[]` を用いたアクセスはとても高速です。
142142
しかし、UTF-8にエンコードされた文字列中の一つ一つの文字は複数のバイトであることが可能なため、
143143
文字列のn番の文字を探すためには文字列上を移動していく必要があります。
144144
そのような作業はとても高コストな演算であり、誤解してはならない点です。
145145
さらに言えば、「文字」というものはUnicodeにおいては正確に定義されていません。
146-
文字列を、それぞれのバイトとして見ることも、コードポインの集まりとして見ることもできるのです
146+
文字列を、それぞれのバイトとして見ることも、コードポイントの集まりとして見ることもできるのです
147147

148148
```rust
149149
let hachiko = "忠犬ハチ公";
@@ -177,7 +177,7 @@ println!("");
177177

178178
```rust
179179
# let hachiko = "忠犬ハチ公";
180-
let dog = hachiko.chars().nth(1); // kinda like hachiko[1]
180+
let dog = hachiko.chars().nth(1); // hachiko[1]のような感じで
181181
```
182182

183183
<!-- This emphasizes that we have to walk from the beginning of the list of `chars`. -->

0 commit comments

Comments
 (0)