Hi!
I need a bit help.
I have a string called a$. And I want to find or replace the LAST Space-Sign. Findstring only give me the first sign. Maybe I can switch the String in the swap order, that means instead a$="ABC", it should be a$ ="CBA"?! The brackground-idea is, that I'm writing a Console-Text-Procedure. After the last known Space-Sign in a line, the Text automatic go to a new line...
[Console] String-editing
[Console] String-editing
PB 4 | WinXP_SP2
Code: Select all
Procedure LastSpace(s.s)
Protected Last = 0
Protected Length = Len(s)
Protected I
While I < Length
If PeekC(@s + I) = ' '
Last = I+1
EndIf
I + SizeOf(Character)
Wend
ProcedureReturn Last/SizeOf(Character)
EndProcedure
a.s = "The quick brown fox jumps over the lazy dog"
Debug Right(a.s, Len(a)-LastSpace(a))