1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24:
| function GetFirstZahlStr(var RestStr: String):String; var i, FoundKommaPoint, lengthStr: Integer; begin result:= ''; lengthStr:= length(RestStr); if lengthStr > 0 then begin FoundKommaPoint:= 0; i:= 1; while (RestStr[i] in ['1','2','3','4','5','6','7','8','9','0',',','.']) and (FoundKommaPoint < 2) and (i <= lengthStr) do begin if RestStr[i] in [',','.'] then inc(FoundKommaPoint); inc(i); end; if FoundKommaPoint > 1 then dec(i); result:= copy(RestStr,1,i-1); RestStr:= copy(RestStr,i,lengthStr-i+1); result:= StringReplace(result,'.',',',[]); end; end; |