- Checks if the first string is a substring of the second one.
- Returns 0 if it is not a substring / 1 if it is / -1 if it is a “circular substring” (see example).
Example:
- abcde is a...
Type: Posts; User: mgutierrez19
- Checks if the first string is a substring of the second one.
- Returns 0 if it is not a substring / 1 if it is / -1 if it is a “circular substring” (see example).
Example:
- abcde is a...
Thank you guys very much for all you help
I know I was noticing that about the return statements also
what would be your suggestions to make sure that the program completely checks that str2 is a substring of str1
public static int substring(String Str1, String Str2)
{
int return = 0
for(int i = 0; i < Str2.length(); i++)
{
if (Str2.charAt(i) == Str1.charAt(0))
for(int j =0; j <...
I need to write a User Defined Method which
Checks if the first string is a substring of the second one.
- Returns 0 if it is not a substring / 1 if it is / -1 if it is a “circular substring” ...