Ignore:
Timestamp:
Mar 5, 2007, 8:46:48 PM (17 years ago)
Author:
OverTaker
Message:

Removeメソッドのバグを修整。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Include/Classes/System/String.ab

    r134 r135  
    338338
    339339    Const Function Remove(startIndex As Long) As String
     340        If startIndex < 0 Or startIndex > m_Length Then
     341            Debug 'ArgumentOutOfRangeException
     342        End If
     343
    340344        Remove.ReSize(startIndex)
    341345        memcpy(Remove.Chars, This.Chars, SizeOf (Char) * startIndex)
     
    343347
    344348    Const Function Remove(startIndex As Long, count As Long) As String
     349        If startIndex < 0 Or count < 0 Or startIndex + count > m_Length Then
     350            Debug 'ArgumentOutOfRangeException
     351        End If
     352
    345353        Remove.ReSize(m_Length - count)
    346354        memcpy(Remove.Chars, This.Chars, SizeOf (Char) * startIndex)
    347         memcpy(VarPtr(Remove.Chars[startIndex]), VarPtr(This.Chars[startIndex + count]), SizeOf (Char) * startIndex)
     355        memcpy(VarPtr(Remove.Chars[startIndex]), VarPtr(This.Chars[startIndex + count]), SizeOf (Char) * (m_Length - startIndex - count))
    348356    End Function
    349357/*
Note: See TracChangeset for help on using the changeset viewer.