Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How to print even and odd position characters of an array of strings in JavaScript

char[] arr={'f','i','r','e','t','r','u','c','k'};
 for(int i=0;i<arr.length;i++){
     if(i%2==1){
         System.out.print(arr[i]);
     }
 }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #How #print #odd #position #characters #array #strings #JavaScript
ADD COMMENT
Topic
Name
8+9 =