This example checks for vowels in the given text and writes them into a list. The output will be e, u, e, o, o, e, o, i, u, i, o, i For each appearance it checks whether the position is an odd number (modulus). If the position is an odd number the character will be converted to upper case using the toUpperCase() function. e - modulus(1,2) = 1 -> E will be upper case u - modulus(2,2) = 0 -> U will be lower case e - modulus(3,2) = 1 -> E will be upper case ... Long story short: Every second vowel will be converted to upper case! |