Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int indexOf(Mystring m) {
- for (int i = 0; i < this.pituus; i++) {
- if (this.mjono[i] == m.charAt(0)) {
- int c = 0;
- for (int j = i; j < this.pituus; j++) {
- if (this.mjono[j] != m.charAt(c))
- break;
- if (m.length() == (c + 1))
- return i;
- c++;
- }
- }
- }
- return -1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement