# Search:

Type: Posts; User: espltdf100

1. ## Thread: Could someone help me with this code?

by espltdf100
Replies
13
Views
681

### [SOLVED] Re: Could someone help me with this code?

public int stringMatch(String a, String b)
{
int match = 0;
int x = 0;
int y = 2;
String aa = a.substring(x,y);
String bb = b.substring(x,y);
...
2. ## Thread: Could someone help me with this code?

by espltdf100
Replies
13
Views
681

### [SOLVED] Re: Could someone help me with this code?

The new code is:

public int stringMatch(String a, String b)
{
int match = 0;
int x = 0;
int y = 2;
String aa = a.substring(x,y);
String bb =...
3. ## Thread: Could someone help me with this code?

by espltdf100
Replies
13
Views
681

### [SOLVED] Re: Could someone help me with this code?

It no longer returns all 0s, but I still don't recieve the expected answer.
The tests are:

stringMatch("xxcaazz", "xxbaaz") → expected 3, got 4
stringMatch("abc", "abc") → expected 2, got...
4. ## Thread: Could someone help me with this code?

by espltdf100
Replies
13
Views
681

### [SOLVED] Re: Could someone help me with this code?

The new code after using the equals method is:

public int stringMatch(String a, String b)
{
int match = 0;
int x = 0;
int y = 2;
5. ## Thread: Could someone help me with this code?

by espltdf100
Replies
13
Views
681

### [SOLVED] Could someone help me with this code?

Though my code compiles, it returns all 0's, and I don't understand why.

The problem I have to answer is :

Given 2 strings, a and b, return the number of the positions where they contain the...
Results 1 to 5 of 5