Multisplit: Difference between revisions

157 bytes removed ,  13 years ago
F#: Nothing wrong here: != preceeds = in string so is allowed to match
(+Java, F# incorrect)
(F#: Nothing wrong here: != preceeds = in string so is allowed to match)
Line 43:
 
=={{header|F_Sharp|F#}}==
 
{{incorrect|F Sharp|<nowiki>In the second example, "!=" should not be matched since all "=" chars should be removed by the first separator listed.</nowiki>}}
If we ignore the "Extra Credit" requirements and skip 'ordered separators' condition (i.e. solving absolute different task), this is exactly what one of the overloads of .NET's <code>String.Split</code> method does. Using F# Interactive:
<lang fsharp>> "a!===b=!=c".Split([|"=="; "!="; "="|], System.StringSplitOptions.None);;
6,962

edits