Tag: char

  • Checks if a specified character exists in a given string in Delphi

    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…