Update all new Tasks
This commit is contained in:
parent
00a190b0a6
commit
91df62d461
5697 changed files with 93386 additions and 804 deletions
|
|
@ -0,0 +1,10 @@
|
|||
defmodule RC do
|
||||
def reverse_words(txt) do
|
||||
txt |> String.split("\n") # split lines
|
||||
|> Enum.map(&( # in each line
|
||||
&1 |> String.split # split words
|
||||
|> Enum.reverse # reverse words
|
||||
|> Enum.join(" "))) # rejoin words
|
||||
|> Enum.join("\n") # rejoin lines
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
txt =
|
||||
"---------- Ice and Fire ------------\n" <>
|
||||
" \n" <>
|
||||
"fire, in end will world the say Some\n" <>
|
||||
"ice. in say Some \n" <>
|
||||
"desire of tasted I've what From \n" <>
|
||||
"fire. favor who those with hold I \n" <>
|
||||
" \n" <>
|
||||
"... elided paragraph last ... \n" <>
|
||||
" \n" <>
|
||||
"Frost Robert -----------------------"
|
||||
|
||||
IO.puts RC.reverse_words(txt)
|
||||
Loading…
Add table
Add a link
Reference in a new issue