Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating material.
Please try to avoid dependencies to third-party libraries and frameworks.
(dorun (map-indexed (fn [i c] (println "Char" i "is" c)) s))
s.split('').asMap().forEach((i, c) => print('Char $i is $c'));
i := 0
for _, c := range s {
fmt.Printf("Char %d is %c\n", i, c)
i++
}
forM_ (zip [0 ..] s) (\(i, c) -> putStrLn $ "Char " ++ show i ++ " is " ++ [c])
for (const [i, c] of [...s].entries()) {
console.log(`Char ${i} is ${c}`);
}
for(int i=0; i<s.length(); i++) {
char c = s.charAt(i);
System.out.println("Char " + i + " is " + c);
}
s.forEachIndexed { i, c ->
println("Char $i is $c")
}
for i, c in enumerate(s):
print(f'Char {i} is {c}')
f = lambda i, c: f'Char {i} is {c}'
for e in enumerate(s): print(f(*e))
s.each_char.with_index{|c, i| puts "Char #{i} is #{c}" }
for (i, c) in s.chars().enumerate() {
println!("Char {} is {}", i, c);
}