15 lines
377 B
Text
15 lines
377 B
Text
import ballerina/io;
|
|
|
|
public function main() returns error? {
|
|
int[] cps = [];
|
|
foreach string c in ["a", "π", "字", "🐘"] {
|
|
int cp = c[0].toCodePointInt();
|
|
cps.push(cp);
|
|
io:println(`${c} = ${cp}`);
|
|
}
|
|
io:println();
|
|
foreach int i in cps {
|
|
var c = check string:fromCodePointInt(i);
|
|
io:println(`${i} = ${c}`);
|
|
}
|
|
}
|