Recent

Author Topic: Tmemo copy sub string  (Read 2611 times)

eldonfsr

  • Hero Member
  • *****
  • Posts: 585
Tmemo copy sub string
« on: October 11, 2023, 11:39:48 pm »
Hello just question i have Tmemo i typed text on it, but when do copy line or substr to another string add some extras charaters

on tmemoe i typed

tm-2

and when  copy or substract
   nl:= MTerminal.Lines.Count;
   textl:=AnsiToUtf8(Mterminal.Lines[nl]);

i got

#6'tm-2'
so when tried to compare what i typed never match... or find text.,,,, there a way to eliminate  extra characters and only get text.

dsiders

  • Hero Member
  • *****
  • Posts: 1612
Re: Tmemo copy sub string
« Reply #1 on: October 12, 2023, 12:17:52 am »
Hello just question i have Tmemo i typed text on it, but when do copy line or substr to another string add some extras charaters

on tmemoe i typed

tm-2

and when  copy or substract
   nl:= MTerminal.Lines.Count;
   textl:=AnsiToUtf8(Mterminal.Lines[nl]);

i got

#6'tm-2'
so when tried to compare what i typed never match... or find text.,,,, there a way to eliminate  extra characters and only get text.

First, Lines are indexed in the range 0..Count-1.

Second, use Trim() on the string value. It removes leading and trailing whitespace or controls characters.

eldonfsr

  • Hero Member
  • *****
  • Posts: 585
Re: Tmemo copy sub string
« Reply #2 on: October 12, 2023, 05:05:46 pm »
Ok Thanks so much your help...

 

TinyPortal © 2005-2018