- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathString.ex
More file actions
Latest commit
25 lines (20 loc) · 643 Bytes
/
Copy pathString.ex
File metadata and controls
25 lines (20 loc) · 643 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
defmoduleSdo
defmaindo
do_stuff()
end
defdo_stuffdo
my_str="My Sentence"
IO.puts("Length : #{String.length(my_str)}")
longer_str=my_str<>" "<>"is longer"
IO.puts("My ? #{String.contains?(my_str,"My")}")
IO.puts("First: #{String.first(my_str)}")
IO.puts("Index 4: #{String.at(my_str,4)}")
IO.puts("Sustring: #{String.slice(my_str,3,8)}")
IO.inspect(String.split(longer_str," "))
IO.puts(String.reverse(longer_str))
IO.puts(String.upcase(longer_str))
IO.puts(String.downcase(longer_str))
IO.puts(String.capitalize(longer_str))
(4*10)|>IO.puts()
end
end