Last active
June 8, 2021 00:02
-
-
Save BrooklinJazz/aa987e42cf3fdf912d83363cd55c349b to your computer and use it in GitHub Desktop.
String Elixir examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| String.length "a string" # 8 | |
| String.contains?("string", "str") # true | |
| String.at("mystring", 2) # s | |
| String.slice("mystring", 2, 3) | |
| String.split("my string", " ") # ["my", "string"] | |
| String.reverse("string") # gnirts | |
| String.upcase("string") # STRING | |
| String.downcase("STRING") # string | |
| String.capitalize("string") # "String" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment