+ 1
How to convert string to char to find what i have assign into that string?
i can ask user to tell thir msg but disable to convert it what it means in my decoding?
4 odpowiedzi
+ 9
System.out.print("" + 'm' + 'a' + 'h' + 'a');
+ 5
To extract a particular alphabet to char, use:-
char c = stringname.charAt(0);
This will extract the character at position 0 in the string. Replace 0 with the index(position) you want. Just remember, it starts from 0, not 1.
To make a char Array of a string use :-
char[] arr = stringname.toCharArray();
+ 1
i have to not mention position. i have to tell for e.g my name is maha so tell me what is on m+a+h+a
+ 1
@Maha I didn't get you question.
Provide sample input and output.