Code: Select all
s.s
:
s=Left(s,a)+Mid(s,a+n)
Code: Select all
RemoveChars(s,a,n)
Michael
Code: Select all
s.s
:
s=Left(s,a)+Mid(s,a+n)
Code: Select all
RemoveChars(s,a,n)
Code: Select all
Structure tChar
StructureUnion
c.c
s.s { 1 }
EndStructureUnion
EndStructure
Procedure.s RemoveChars ( sSource.s , nStarChar.i , nLength.i )
Protected *Source .tChar = @ sSource
Protected *CutPartStart = *Source + ( nStarChar * SizeOf ( tChar ) )
Protected *CutPartEnd = *CutPartStart + ( nLength * SizeOf ( tChar ) )
Protected sTemp .s
If Not *Source
ProcedureReturn sSource
EndIf
While *Source\c
If *Source < *CutPartStart Or *Source => *CutPartEnd
sTemp + *Source\s
EndIf
*Source + SizeOf ( tChar )
Wend
ProcedureReturn sTemp
EndProcedure
Debug RemoveChars ( "Hello world" , 9 , 1 )
Debug RemoveChars ( "Feel the pure power" , 10 , 5 )