anchor.diff:                              // Is the current character a separator?
                               if Char.IsWhiteSpace str.[i] then
                                   // Apply the function to the current substring.
  -                                state <- folder.Invoke (state, Substring (str, offset, length))
  +                                state <- folder.Invoke (state, substring (str, offset, length))
   
                                   // Update the offset to just past the end of this substring
                                   // and reset the length to zero to begin a new substring.
  
positive.code:     /// Gets a substring of a string.
      [<CompiledName("Sub")>]
      let inline sub (str : string) offset count : substring =
          Substring (str, offset, count)
  
      /// Returns the index of the first occurrence of a specified character within a string.
      [<CompiledName("TryFindIndexOf")>]
  
negative.code:         let startIndex = defaultArg startIndex 0
          let finishIndex = defaultArg finishIndex this.Length
  
          substring (
              this.String,
              this.Offset + startIndex,
              finishIndex - startIndex + 1)
  
  
  /// Functional operators related to substrings.
  [<RequireQualifiedAccess; CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
  module substring =
      open OptimizedClosures
  
      /// Returns the string underlying the given substring.
      [<CompiledName("String")>]
      let inline string (substr : substring) : string =
          substr.String
  
      /// The starting offset of the substring within it's underlying string.
      [<CompiledName("Offset")>]
      let inline offset (substr : substring) : int =
          substr.Offset
  
      /// Returns the length of the substring.
      [<CompiledName("Length")>]
      let inline length (substr : substring) : int =
          substr.Length
  
      /// Gets a character from the substring.
      [<CompiledName("Get")>]
      let inline get (substr : substring) index : char =
          substr.[index]
  
      /// Is the substring empty?
      [<CompiledName("IsEmpty")>]
      let inline isEmpty (substr : substring) : bool =
          substr.IsEmpty
  
      /// Returns a substring which covers the entire length of the given string.
      [<CompiledName("OfString")>]
      let inline ofString (str : string) : substring =
          substring (str, 0, str.Length)
  
      /// Instantiates the substring as a string.
      [<CompiledName("ToString")>]
      let inline toString (substr : substring) : string =
          substr.ToString ()
  
      /// Returns the characters in the given substring as a Unicode character array. 
      [<CompiledName("ToArray")>]
      let inline toArray (substr : substring) : char[] =
          substr.ToArray ()
  
      /// Gets a substring of a substring.
      [<CompiledName("Sub")>]
      let sub (substr : substring) offset count : substring =
          // Preconditions
          if offset < 0 then
              argOutOfRange "offset" "The offset cannot be negative."
          elif count < 0 then
              argOutOfRange "count" "The length of the substring cannot be negative."
          elif offset >= substr.Length then
              argOutOfRange "offset" "The offset must be less than the length of the input substring."
          elif (offset + count) >= substr.Length then
              argOutOfRange "count" "There are fewer than 'count' elements in the \
                                     input substring when starting at the given offset."
  
          // Create a new substring based on the input substring.
          substring (substr.String, substr.Offset + offset, count)
  
      /// Builds a new string by concatenating the given sequence of substrings.
      [<CompiledName("Concat")>]
      let concat (substrs : seq<substring>) : string =
          // Preconditions
          checkNonNull "substrs" substrs
  
          // If the sequence is empty, return immediately.
          if Seq.isEmpty substrs then
              System.String.Empty
          else
              let sb = System.Text.StringBuilder ()
              substrs |> Seq.iter (sb.Append >> ignore)
              sb.ToString ()
  
      /// Applies the given function to each character in the substring,
      /// in order from lowest to highest indices.
      [<CompiledName("Iterate")>]
      let iter action (substr : substring) : unit =
          let len = substr.Length
          for i = 0 to len - 1 do
              action substr.[i]
  
      /// Applies the given function to each character in the substring,
      /// in order from lowest to highest indices.
      /// The integer index applied to the function is the character's index within the substring.
      [<CompiledName("IterateIndexed")>]
      let iteri action (substr : substring) : unit =
          // OPTIMIZATION : Immediately return if the substring is empty.
          let len = substr.Length
          if len > 0 then
              let action = FSharpFunc<_,_,_>.Adapt action
  
              for i = 0 to len - 1 do
                  action.Invoke (i, substr.[i])
  
      /// Applies the given function to each character in the substring,
      /// in order from highest to lowest indices.
      [<CompiledName("IterateBack")>]
      let iterBack action (substr : substring) : unit =
          let len = substr.Length
          for i = len - 1 downto 0 do
              action substr.[i]
  
      /// Applies a function to each character of the substring, threading an accumulator
      /// argument through the computation.
      /// If the input function is f and the characters are c0...cN then computes f (...(f s c0)...) cN.
      [<CompiledName("Fold")>]
      let fold (folder : 'State -> char -> 'State) state (substr : substring) : 'State =
          // OPTIMIZATION : Immediately return if the substring is empty.
          let len = substr.Length
          if len = 0 then state
          else
              let folder = FSharpFunc<_,_,_>.Adapt folder
              
              let mutable state = state
              for i = 0 to len - 1 do
                  state <- folder.Invoke (state, substr.[i])
              state
  
      /// Applies a function to each character of the substring, threading an accumulator
  