1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

概要

paiza.ioでelixirやってみた。
String.valid?使ってみた。

サンプルコード

:unicode.characters_to_nfd_binary("だ")
|> IO.puts
[65, 66, 67, 68, 69] 
|> IO.inspect(charlists: :as_lists)


String.valid?("hello")  
 |> IO.inspect

String.valid?("")   
 |> IO.inspect
String.valid?('world')   
 |> IO.inspect
String.valid?(nil)    
 |> IO.inspect
String.valid?(100)   
 |> IO.inspect
String.valid?(<<128, 129, 130>>) 
 |> IO.inspect
String.valid?( [65, 66, 67, 68, 69])
 |> IO.inspect

実行結果

だ
[65, 66, 67, 68, 69]
true
true
false
false
false
false
false

成果物

以上。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?