Funkcja jako argument przyjmuje obiekt TStrings oraz separator, którym zostaną oddzielone kolejne elementy TStrings. Funkcja zwraca rezultat łączenia.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
function Join(ASt: TStrings; ASep: String): String; var i: Integer; begin Result := ''; for i := 0 to ASt.Count - 2 do // z -2 zeby nizej dodac bez Sep'a Result := Result + ASt + ASep; Result := Result + ASt[ASt.Count - 1]; // ostatni dodaj bez Sep'a end; |
Autor: Kkkas