'  FF_STRDELETE
'  从字符串表达式删除指定的数目的字符。
'  返回基于 MainString 字符 nStart起始位置 删除 nCount个字符。字符串中的第一个字符处于位置 1，等等。
'  Function FF_StrDelete( ByRef sMainString as String, _
'                         ByRef nStart      as Integer, _
'                         ByRef nCount      as Integer _
'                         ) as String
''
''  FF_STRDELETE
''  Delete a specified number of characters from a string expression.
''
''  Returns a string based on MainString but with nCount characters deleted 
''  starting at position nStart. The first character in the string is position 1, etc.
'' 
Function FF_StrDelete( ByRef sMainString as String, _
                       ByRef nStart      as Integer, _
                       ByRef nCount      as Integer _
                       ) as String

   Dim nLenMain as Integer = Len(sMainString)
   
   If nStart > nLenMain Then Return sMainString
   If nStart < 0        Then Return sMainString
   If nCount <= 0       Then Return sMainString
   If nStart = 0        Then nStart = nLenMain - nCount
      
   Dim s as String
   s = Left(sMainString, nStart-1) & Mid(sMainString, nStart+nCount+1)
   Function = s
End Function
