0

Tel me a java code for this qusestion->Suppose my name is yogesh & if i write csyogeshbs then java should only count yogesh ...

Tel me a java code for this question ....... Suppose my name is yogesh & if i write SSyogeshSS then java should not count SS______SS but only count yogesh and accept it ......

31st Oct 2017, 7:08 PM
Yogesh Bhatt
Yogesh Bhatt - avatar
4 Antworten
+ 2
String str = "SsyogeshSs"; int n = str.indexOf("yogesh"); // 2
31st Oct 2017, 7:20 PM
Chriptus13
Chriptus13 - avatar
+ 1
Because the word start on position 2
1st Nov 2017, 2:20 PM
Chriptus13
Chriptus13 - avatar
0
why it is giving 2 output?
1st Nov 2017, 4:19 AM
Yogesh Bhatt
Yogesh Bhatt - avatar
0
okkk fine
1st Nov 2017, 5:34 PM
Yogesh Bhatt
Yogesh Bhatt - avatar