Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional code examples for JP01 #3

Open
Freymaurer opened this issue Mar 19, 2020 · 0 comments
Open

Additional code examples for JP01 #3

Freymaurer opened this issue Mar 19, 2020 · 0 comments

Comments

@Freymaurer
Copy link
Member

Beispiel für Pipe-Operatoren:
Eine Funktion die einen String nach allen n Characters unterteilt, so dass der Output ein Array von Strings ist:

let chunkString (string: string) size =
    string.ToCharArray()
    |> Array.chunkBySize size
    |> Array.map (fun x -> new string (x))

let size = 3 
let nameString="Maiskolben"

chunkString  nameString size  

->  [|"Mai";"sko";"lbe";"n"|]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant