- 2
Hiw do i print the even chars in java
I want print the even chars from the given string
6 odpowiedzi
+ 10
for (int i = 0; i < STRING_SIZE; i+=2)
{
// print some_str[i];
}
// where STRING_SIZE is your string length / number of characters in the string.
+ 5
@Mohan
Oh...I understand now srry for don't understand you xD
@Abdul Moqueet
I'm gonna type the code like that!
+ 4
@Mohan
._. Alternative chars.....
You mean 'A','B' like this?
0
guys use print alternative chars method u will easily print the even chars
0
@veryhard
main()
string a="veryhard";
char[] c=a.toCharArray();
for(int I=0;I<c.length;I++)
{
sop(c[I]));
}
}
this is for print alternative chars
if u give I=1 then it will print even chars
- 1
full code please hatsey rei