Adding to unicode

I'm trying to take a phrase from user (EX. "ABC"), and add 2 to the Unicode. After adding two to the Unicode, it would then convert it back to a character. for example: input: ABC output: CDE
No description
4 Replies
rainymc_
rainymc_OP4w ago
I can get the unicode but how do I convert it back into a character
tjoener
tjoener4w ago
The simplest way to do it is something like
char[] chars = string.toCharArray();
for(int i = 0; i < chars.length; i++) {
chars[i] += 2;
}
String result = new String(chars);
char[] chars = string.toCharArray();
for(int i = 0; i < chars.length; i++) {
chars[i] += 2;
}
String result = new String(chars);
JavaBot
JavaBot4w ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Want results from more Discord servers?
Add your server