From c777c6a85aaa27bd11b7128415ff08e018bc166d Mon Sep 17 00:00:00 2001 From: Abel Braaksma Date: Thu, 18 Jun 2020 01:29:26 +0200 Subject: [PATCH] Move `String.length` to the top of its module so that the `length` function is in scope --- src/fsharp/FSharp.Core/string.fs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fsharp/FSharp.Core/string.fs b/src/fsharp/FSharp.Core/string.fs index df51fccd03..7e4b65f1a0 100644 --- a/src/fsharp/FSharp.Core/string.fs +++ b/src/fsharp/FSharp.Core/string.fs @@ -12,6 +12,9 @@ namespace Microsoft.FSharp.Core [] [] module String = + [] + let length (str:string) = if isNull str then 0 else str.Length + [] let concat sep (strings : seq) = String.Join(sep, strings) @@ -101,6 +104,3 @@ namespace Microsoft.FSharp.Core else let rec check i = (i < str.Length) && (predicate str.[i] || check (i+1)) check 0 - - [] - let length (str:string) = if isNull str then 0 else str.Length