Is there a string contains function for scar? Thanks in advance
Sorry, what? Do you mean like something to check to see if a string contains a certain substring?
like stringcontains(stringtolookin:string, stringtosearchfor:string):boolean alough that isn't a real function (i don't think at least)
You mean stuff like this?:
boolean = true/false
integer = whole numbers
extended = decimals
string = letters
or what?
function pos(substr, s: string): Longint
This looks for the substring inside string 's'. If it is found it will tell you at what position in the string the substring starts at. If it is not found, it returns 0.
So to check if the substring was in it, you could do
SCAR Code:if (pos('str', 'string') != 0) then
writeln('Found substring!');
Lol omghax0rz do you read the srl and scar manuals for fun?
yup
jk



That's not in the SRL manual... but I read it for fun.
SCAR Code:function StrContains(Str, Substr: String): Boolean;
begin
Result:= (Pos(Substr, Str) <> 0);
end;
There are currently 1 users browsing this thread. (0 members and 1 guests)