Restored from previous forum. Originally posted by Starax.
Is there a command to place a string within another string?
Example:
S1$="one three"
Mid(S1$,4)="two "
print S1$
> one two three
Mid(A$,20)="Blah blah"
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Danilo.
cya,
...Danilo
(registered PureBasic user)
Code: Select all
Procedure.s InsertString(source.s,pos,newstring.s)
ProcedureReturn Left(source,pos)+newstring+Right(source,Len(source)-pos)
EndProcedure
OpenConsole()
ReplaceStExample:
S1$ = "one three"
PrintN(S1$)
S1$ = InsertString(S1$,4,"two ")
PrintN(S1$)
Input()
...Danilo
(registered PureBasic user)
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Fangbeast.
Starax Danilo's example is a good start but also do a search for Franco's templates as he had lots of these sorts of examples and it got me started last year. They will be somewhere here in the forum still (I hope) and/or on Paul's resource site.
Fangles woz ear orright den?
Starax Danilo's example is a good start but also do a search for Franco's templates as he had lots of these sorts of examples and it got me started last year. They will be somewhere here in the forum still (I hope) and/or on Paul's resource site.
Fangles woz ear orright den?
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm