Here you can find the source of modifyBase32AtIndex(final String s, final int index)
Parameter | Description |
---|---|
s | A base 32 string |
index | The index of the character to change |
public static String modifyBase32AtIndex(final String s, final int index)
//package com.java2s; //License from project: Open Source License public class Main { /**//from ww w.j a va2 s . c o m * Changes a single character in the specified base 32 string. * * @param s A base 32 string * @param index The index of the character to change * @return The resulting base 32 string */ public static String modifyBase32AtIndex(final String s, final int index) { final char[] chars = s.toCharArray(); final char currentChar = chars[index]; char newChar = (char) (currentChar + 1); switch (currentChar) { case 'Z': case '7': newChar = 'A'; } chars[index] = newChar; return new String(chars); } }