225k views
1 vote
Given the string variable address, write an expression that returns the position of the first occurrence of the string "avenue" in address. submit

User Chaooder
by
5.2k points

1 Answer

1 vote
string temp;

for i = 0 to Address.length - 6 do
begin
temp = copy(address, i, i + 6) //returns a substring of a string beginning at
//i and ending at i + 6
if temp = 'Avenue' then
return i;

end;
User Kurisu
by
4.8k points