Skip to content

Commit

Permalink
r/to_char_list/to_charlist/ (elixirschool#880)
Browse files Browse the repository at this point in the history
Now it's best to use `to_charlist/1` since `to_char_list/1` is being
deprecated (see elixir-lang/elixir#4909).
  • Loading branch information
jmitchell authored and doomspork committed Dec 18, 2016
1 parent 2e60fd2 commit 2edaa74
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions cn/lessons/advanced/erlang.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Erlang:
'Example String'.
```

需要特别注意的是,有些 Erlang 的库不支持 binaries,我们要把 Elixir 字符串转换成字符列表,不过还好 `to_char_list/1` 函数可以帮我们完成这个转换。
需要特别注意的是,有些 Erlang 的库不支持 binaries,我们要把 Elixir 字符串转换成字符列表,不过还好 `to_charlist/1` 函数可以帮我们完成这个转换。

```elixir
iex> :string.words("Hello World")
Expand All @@ -91,7 +91,7 @@ iex> :string.words("Hello World")
(stdlib) string.erl:378: :string.strip/3
(stdlib) string.erl:316: :string.words/2

iex> "Hello World" |> to_char_list |> :string.words
iex> "Hello World" |> to_charlist |> :string.words
2
```

Expand Down
4 changes: 2 additions & 2 deletions de/lessons/advanced/erlang.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ false
true
```

Es ist wichtig sich zu merken, dass viele ältere Erlang-Bibliotheken keine binaries unterstützen und wir somit Elixir strings in char lists umwandeln müssen. Glücklicherweise ist das mit der `to_char_list/1`-Funktion kein Problem:
Es ist wichtig sich zu merken, dass viele ältere Erlang-Bibliotheken keine binaries unterstützen und wir somit Elixir strings in char lists umwandeln müssen. Glücklicherweise ist das mit der `to_charlist/1`-Funktion kein Problem:

```elixir
iex> :string.words("Hello World")
Expand All @@ -110,7 +110,7 @@ iex> :string.words("Hello World")
(stdlib) string.erl:378: :string.strip/3
(stdlib) string.erl:316: :string.words/2

iex> "Hello World" |> to_char_list |> :string.words
iex> "Hello World" |> to_charlist |> :string.words
2
```

Expand Down
4 changes: 2 additions & 2 deletions es/lessons/advanced/erlang.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ false
true
```

Es importante tener en cuenta que muchas bibliotecas Erlang más antiguas podrían no soportar binarios, por lo que necesitamos convertir cadenas Elixir a lista de caracteres. Afortunadamente esto es fácil de lograr con la función `to_char_list/1`:
Es importante tener en cuenta que muchas bibliotecas Erlang más antiguas podrían no soportar binarios, por lo que necesitamos convertir cadenas Elixir a lista de caracteres. Afortunadamente esto es fácil de lograr con la función `to_charlist/1`:

```elixir
iex> :string.words("Hello World")
Expand All @@ -108,7 +108,7 @@ iex> :string.words("Hello World")
(stdlib) string.erl:378: :string.strip/3
(stdlib) string.erl:316: :string.words/2

iex> "Hello World" |> to_char_list |> :string.words
iex> "Hello World" |> to_charlist |> :string.words
2
```

Expand Down
4 changes: 2 additions & 2 deletions gr/lessons/advanced/erlang.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ false
true
```

Είναι σημαντικό να σημειώσουμε ότι πολλές παλαιότερες βιβλιοθήκες της Erlang μπορεί να μην υποστηρίζουν τα δυαδικά, έτσι πρέπει να μετατρέψουμε τα αλφαριθμητικά της Elixir σε λίστες χαρακτήρων. Ευτυχώς αυτό είναι εύκολο να γίνει με την συνάρτηση `to_char_list/1`:
Είναι σημαντικό να σημειώσουμε ότι πολλές παλαιότερες βιβλιοθήκες της Erlang μπορεί να μην υποστηρίζουν τα δυαδικά, έτσι πρέπει να μετατρέψουμε τα αλφαριθμητικά της Elixir σε λίστες χαρακτήρων. Ευτυχώς αυτό είναι εύκολο να γίνει με την συνάρτηση `to_charlist/1`:

```elixir
iex> :string.words("Γειά σου Κόσμε")
Expand All @@ -110,7 +110,7 @@ iex> :string.words("Γειά σου Κόσμε")
(stdlib) string.erl:378: :string.strip/3
(stdlib) string.erl:316: :string.words/2

iex> "Γειά σου Κόσμε" |> to_char_list |> :string.words
iex> "Γειά σου Κόσμε" |> to_charlist |> :string.words
3
```

Expand Down
4 changes: 2 additions & 2 deletions id/lessons/advanced/erlang.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ false
true
```

Adalah penting dicatat bahwa banyak librari Erlang yang lawas mungkin tidak mendukung binary sehingga kita perlu mengkonversi string Elixir ke char list. Untungnya hal ini mudah dikerjakan dengan fungsi `to_char_list/1`:
Adalah penting dicatat bahwa banyak librari Erlang yang lawas mungkin tidak mendukung binary sehingga kita perlu mengkonversi string Elixir ke char list. Untungnya hal ini mudah dikerjakan dengan fungsi `to_charlist/1`:

```elixir
iex> :string.words("Hello World")
Expand All @@ -110,7 +110,7 @@ iex> :string.words("Hello World")
(stdlib) string.erl:378: :string.strip/3
(stdlib) string.erl:316: :string.words/2

iex> "Hello World" |> to_char_list |> :string.words
iex> "Hello World" |> to_charlist |> :string.words
2
```

Expand Down
4 changes: 2 additions & 2 deletions jp/lessons/advanced/erlang.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ false
true
```

重要なので注記しておくと、古いErlangライブラリではバイナリに対応していないものが多いため、Elixirの文字列は文字リストに変換する必要があります。ありがたいことに、これは`to_char_list/1`関数を用いて簡単に行うことができます:
重要なので注記しておくと、古いErlangライブラリではバイナリに対応していないものが多いため、Elixirの文字列は文字リストに変換する必要があります。ありがたいことに、これは`to_charlist/1`関数を用いて簡単に行うことができます:

```elixir
iex> :string.words("Hello World")
Expand All @@ -110,7 +110,7 @@ iex> :string.words("Hello World")
(stdlib) string.erl:378: :string.strip/3
(stdlib) string.erl:316: :string.words/2

iex> "Hello World" |> to_char_list |> :string.words
iex> "Hello World" |> to_charlist |> :string.words
2
```

Expand Down
4 changes: 2 additions & 2 deletions ko/lessons/advanced/erlang.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ false
true
```

한 가지 중요한 점은, 대부분의 오래된 Erlang 라이브러리는 바이너리를 지원하지 않기 때문에 Elixir 문자열을 문자 리스트로 변환해야 한다는 것입니다. 다행스럽게도 이 작업은 `to_char_list/1` 함수를 이용하여 손쉽게 할 수 있습니다.
한 가지 중요한 점은, 대부분의 오래된 Erlang 라이브러리는 바이너리를 지원하지 않기 때문에 Elixir 문자열을 문자 리스트로 변환해야 한다는 것입니다. 다행스럽게도 이 작업은 `to_charlist/1` 함수를 이용하여 손쉽게 할 수 있습니다.

```elixir
iex> :string.words("Hello World")
Expand All @@ -110,7 +110,7 @@ iex> :string.words("Hello World")
(stdlib) string.erl:378: :string.strip/3
(stdlib) string.erl:316: :string.words/2

iex> "Hello World" |> to_char_list |> :string.words
iex> "Hello World" |> to_charlist |> :string.words
2
```

Expand Down
4 changes: 2 additions & 2 deletions lessons/advanced/erlang.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ false
true
```

It's important to note that many older Erlang libraries may not support binaries so we need to convert Elixir strings to char lists. Thankfully this is easy to accomplish with the `to_char_list/1` function:
It's important to note that many older Erlang libraries may not support binaries so we need to convert Elixir strings to char lists. Thankfully this is easy to accomplish with the `to_charlist/1` function:

```elixir
iex> :string.words("Hello World")
Expand All @@ -110,7 +110,7 @@ iex> :string.words("Hello World")
(stdlib) string.erl:378: :string.strip/3
(stdlib) string.erl:316: :string.words/2

iex> "Hello World" |> to_char_list |> :string.words
iex> "Hello World" |> to_charlist |> :string.words
2
```

Expand Down
4 changes: 2 additions & 2 deletions my/lessons/advanced/erlang.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ false
true
```

Penting untuk diperhatikan bahawa banyak pustaka Erlang yang lama mungkin tidak menyokong 'binary' jadi kita perlu menukarkan string Elixir kepada list aksara. Nasib baik ianya mudah untuk dilakukan dengan menggunakan fungsi `to_char_list/1`:
Penting untuk diperhatikan bahawa banyak pustaka Erlang yang lama mungkin tidak menyokong 'binary' jadi kita perlu menukarkan string Elixir kepada list aksara. Nasib baik ianya mudah untuk dilakukan dengan menggunakan fungsi `to_charlist/1`:

```elixir
iex> :string.words("Hello World")
Expand All @@ -110,7 +110,7 @@ iex> :string.words("Hello World")
(stdlib) string.erl:378: :string.strip/3
(stdlib) string.erl:316: :string.words/2

iex> "Hello World" |> to_char_list |> :string.words
iex> "Hello World" |> to_charlist |> :string.words
2
```

Expand Down
4 changes: 2 additions & 2 deletions pl/lessons/advanced/erlang.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ false
true
```

Musimy pamiętać, że wiele starszych bibliotek Erlanga, nie wspiera formy binarnej i musimy zamienić ciągi znaków z Elixira na listy. Na całe szczęście mamy do tego odpowiednią funkcję `to_char_list/1`:
Musimy pamiętać, że wiele starszych bibliotek Erlanga, nie wspiera formy binarnej i musimy zamienić ciągi znaków z Elixira na listy. Na całe szczęście mamy do tego odpowiednią funkcję `to_charlist/1`:

```elixir
iex> :string.words("Hello World")
Expand All @@ -111,7 +111,7 @@ iex> :string.words("Hello World")
(stdlib) string.erl:378: :string.strip/3
(stdlib) string.erl:316: :string.words/2

iex> "Hello World" |> to_char_list |> :string.words
iex> "Hello World" |> to_charlist |> :string.words
2
```

Expand Down
4 changes: 2 additions & 2 deletions pt/lessons/advanced/erlang.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ false
true
```

É importante notar que muitas bibliotecas Erlang antigas podem não suportar binários, então precisamos converter *strings* Elixir em lista de caracteres. Felizmente isso é fácil de conseguir com a função `to_char_list/1`:
É importante notar que muitas bibliotecas Erlang antigas podem não suportar binários, então precisamos converter *strings* Elixir em lista de caracteres. Felizmente isso é fácil de conseguir com a função `to_charlist/1`:

```elixir
iex> :string.words("Hello World")
Expand All @@ -110,7 +110,7 @@ iex> :string.words("Hello World")
(stdlib) string.erl:378: :string.strip/3
(stdlib) string.erl:316: :string.words/2

iex> "Hello World" |> to_char_list |> :string.words
iex> "Hello World" |> to_charlist |> :string.words
2
```

Expand Down
4 changes: 2 additions & 2 deletions ru/lessons/advanced/erlang.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ false
true
```

Многие старые библиотеки Erlang могут не поддерживать бинарные строки, потому нужно рассмотреть как превращать строки Elixir в строковые списки. К счастью, это легко достигается функцией `to_char_list/1`:
Многие старые библиотеки Erlang могут не поддерживать бинарные строки, потому нужно рассмотреть как превращать строки Elixir в строковые списки. К счастью, это легко достигается функцией `to_charlist/1`:

```elixir
iex> :string.words("Hello World")
Expand All @@ -110,7 +110,7 @@ iex> :string.words("Hello World")
(stdlib) string.erl:378: :string.strip/3
(stdlib) string.erl:316: :string.words/2

iex> "Hello World" |> to_char_list |> :string.words
iex> "Hello World" |> to_charlist |> :string.words
2
```

Expand Down
2 changes: 1 addition & 1 deletion vi/lessons/advanced/erlang.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ iex> :string.words("Hello World")
(stdlib) string.erl:378: :string.strip/3
(stdlib) string.erl:316: :string.words/2

iex> "Hello World" |> to_char_list |> :string.words
iex> "Hello World" |> to_charlist |> :string.words
2
```

Expand Down

0 comments on commit 2edaa74

Please sign in to comment.