Another update from ingydotnet^djgoku
This commit is contained in:
parent
91df62d461
commit
948b86eafa
7604 changed files with 108452 additions and 22726 deletions
|
|
@ -1,2 +1,10 @@
|
|||
command.com
|
||||
color f0
|
||||
>set r=Rosetta
|
||||
|
||||
>set c=Code
|
||||
|
||||
>set s=:
|
||||
|
||||
>echo %r%%s%%s%%c%
|
||||
Rosetta::Code
|
||||
|
||||
>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
iex(1)> f = fn str1,str2,sep -> [str1,"",str2] |> Enum.join(sep) end # Join list on seperator
|
||||
iex(2)> g = fn str1,str2,sep -> str1 <> sep <> sep <> str2 end # Or concatenate strings
|
||||
|
||||
iex(3)> defmodule JoinStrings do
|
||||
...(3)> def f(str1,str2,sep), do: [str1,"",str2] |> Enum.join(sep)
|
||||
...(3)> def g(str1,str2,sep), do: str1 <> sep <> sep <> str2
|
||||
...(3)> end
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
iex(4)> f.("Rosetta","Code",":")
|
||||
"Rosetta::Code"
|
||||
iex(5)> JoinStrings.f("Rosetta","Code",":")
|
||||
"Rosetta::Code"
|
||||
|
|
@ -1,5 +1 @@
|
|||
function x=f(a,b,sep)
|
||||
x = [a,sep,b];
|
||||
return;
|
||||
end;
|
||||
f('Rosetta', 'Code', ':')
|
||||
>> f = @(str1, str2, delim) [str1, delim, delim, str2];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue