1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
function CharExistsInString(const AString: string; AChar: Char): Boolean; var i: Integer; begin Result := False; for i := 1 to Length(AString) do begin if AString[i] = AChar then begin Result := True; Break; end; end; end; |
This function takes two parameters: AString
, which is the string to search within, and AChar
, which is the character to search for. It iterates over each character in the string using a loop, comparing each character with the specified character. If a match is found, it returns True
; otherwise, it returns False
.
Leave a Reply