+ 1
Anyone can make a program in java with below description ??
Write a java program which takes a character and a sentence as input. Print the position numbers where the character appears in that line. If the character does not appears in the sentence at all, print -1. Input Specification : First input is a single character. Second input is a sentence. Output Specification: Print the position numbers at where that character appears in the sentence. If the character does not appears in the sentence at all, print -1.
15 Answers
+ 4
ooooo
+ 4
Here you go
https://code.sololearn.com/cXHCnoJ1Trsr/?ref=app
+ 4
limitless_za for Instagram
+ 3
Can you give an example?
+ 3
Like input - output example
+ 3
Do you have Discord?
+ 2
There's already a function that does for you.
String.indexOf(char);
https://code.sololearn.com/c3KZFf8weUUH/?ref=app
+ 1
if you are on whatsapp or facebook tell me.. its hard to write code again and again. I will send u picture of my code.It works well. However it didnt passes the test cases
0
i want all occurance of a char in a string
0
Yes,
input : i i love java
output : 1
input: i this is Ignite
output : 3 6 9 12
0
Thanks i knw it works. Still it didnt passes the test cases
0
i cant send u screenshot here, can u give ur fb id?
0
what is discord?
0
i have fb, instagram, whatsapp.. i can send u screenshot there