Skip to content

Commit 2341b8c

Browse files
committed
[Add] sigils
1 parent 80c09f6 commit 2341b8c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

sigils.exs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Useful when a string contains double quotes
2+
sigil = ~s(this is a string with "double" quotes, not 'single' ones)
3+
4+
IO.puts sigil
5+
6+
# Useful when a string contains single quotes
7+
sigil2 = ~c(this is a char list containing 'single quotes')
8+
9+
IO.puts sigil2
10+
11+
# Accepts the c (chars), s (strings) and a (atoms) modifiers
12+
sigil3 = ~w(foo bar)
13+
sigil4 = ~w(foo bar bat)a
14+
15+
IO.puts sigil3

0 commit comments

Comments
 (0)