How to get the ascii code of a character in a string? (pjs)
in
Processing with Other Languages
•
3 months ago
Hi,
I can't figure this one out:
String drivingme = "nuts";
println(byte(drivingme.charAt(1))); // 0
println(byte("u")); // 0
println(byte('u')); // 117
I need the ascii codes of each letter in a string.
It works fine on P5, not in P5JS.
Doing a char("u") crashes the program.
Any tips?
a
I can't figure this one out:
String drivingme = "nuts";
println(byte(drivingme.charAt(1))); // 0
println(byte("u")); // 0
println(byte('u')); // 117
I need the ascii codes of each letter in a string.
It works fine on P5, not in P5JS.
Doing a char("u") crashes the program.
Any tips?
a
1