Hello, all!
Working on a program to take a string, iterate through each character on at a time, modify those characters by an offset value to change them into new characters, and spit out the result. Having an odd issue trying to assign a character from a StringBuffer to a char.
Line 4 of that bit is where I'm getting an index out of range: -1 exception. text is a StringBuffer.Code:for (int i = 0; i <= text.length(); i--)
{
// Pull one character from string
char tempChar = text.charAt(i);
// Get the value of the character
value = Character.getNumericValue(tempChar);
if (negative = true)
// Adjust the value of the character by the offset
value = value - offset;
else
// Adjust the value of the character by the offset
value = value + offset;
// Convert value back into a character
tempChar = (char) value;
// Append to result string
result.append(Character.toString(tempChar));
}
Any ideas? Clearly I've done something wrong.
Thanks in advance!

