Last active
September 13, 2020 00:21
-
-
Save adworse/271cce9316e9802f22b6d2c40f224a44 to your computer and use it in GitHub Desktop.
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
defmodule Naive do | |
def trim_name do | |
name | |
|> String.codepoints | |
|> Enum.take(80) | |
|> to_string | |
end | |
end | |
iex> Repo.insert(%Company{name: name |> Naive.trim_name}) | |
{:ok, %Company{name: "समुद्र के भीतर अचानक जब बड़ी तेज़ हलचल होने लगती है तो उसमें तूफान उठता है जिससे"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment