Hey I made it so your first letter is always capital when you type but how do I make it so if you use shift for the first letter it will make it capital but not the second letter.
cause that's what it keeps doing.
basically if I do shift for a word like this: HuGe
it will make it: HuGE
it makes the leter after the shift capital to.
Code:
public static String capitalize(String s) {
for (int i = 0; i < s.length(); i++) {
if (i == 0) {
s = String.format( "%s%s",
Character.toUpperCase(s.charAt(0)),
s.substring(1) );
}
if (!Character.isLetterOrDigit(s.charAt(i))) {
if (i + 1 < s.length()) {
s = String.format( "%s%s%s",
s.subSequence(0, i+1),
Character.toUpperCase(s.charAt(i + 1)),
s.substring(i+2) );
}
}
}
return s;
}
Code:
public static void method526(String s, Stream stream)
{
if(s.length() > 80)
s = s.substring(0, 80);
//s = s.toLowerCase();
int i = -1;
for(int j = 0; j < s.length(); j++)
{
char c = s.charAt(j);
int k = 0;
for(int l = 0; l < validChars.length; l++)
{
if(c != validChars[l])
continue;
k = l;
break;
}
stream.writeWordBigEndian(k);//sending to server
}
}
Thanks!