156k views
2 votes
Given the string variable address, write an expression that returns the position of the first occurrence of the string avenue in address.

User Helmisek
by
6.8k points

1 Answer

4 votes
It depends on a language you code. I think this could be either C++ or Java. I know answer for both of them.
For C++: address.find("Avenue")
For Java: address.indexOf("Avenue")
User Dest
by
8.0k points