feat: refactoring

This commit is contained in:
2023-06-05 16:58:36 +04:00
parent 059ea3db5b
commit 5c6acc30a4

View File

@@ -9,9 +9,7 @@ open System
type Note = { Name: string; Length: int } type Note = { Name: string; Length: int }
let parseNotes (input: string) = let parseNotes (input: string) =
let gluedString = input.Replace('\n', ' ') input.Replace('\n', ' ').Split(' ', StringSplitOptions.RemoveEmptyEntries)
gluedString.Split(' ', StringSplitOptions.RemoveEmptyEntries)
|> Seq.map (fun noteStr -> |> Seq.map (fun noteStr ->
let noteSigns = noteStr.Split('-') let noteSigns = noteStr.Split('-')
let name = noteSigns[0].Trim() let name = noteSigns[0].Trim()