Question : Delphi manupliate string return only integer part

Good day

I have a string that might look like this :
TT=16
or
TT=6 test test
or
TT=1
or
TT=8888 this is a line

I need to return only the integer part after theTT=

How can I accomplish this

thanx

Answer : Delphi manupliate string return only integer part

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
  function ExtractNumber(s: string): integer;
  var i: integer;
  begin
    if Pos('=', s) > 0 then
      s := Copy(s, Pos('=', s)+1, Length(s));
    for i := 1 to Length(s) do
      if not (s[i] in ['0'..'9']) then
      begin
        System.Delete(s, i, Length(s));
        break;
      end;
    Result := StrToIntDef(s,0);
  end;
Random Solutions  
 
programming4us programming4us