how to print a sentence out in a string of camel case java
boolean shouldConvertNextCharToLower = true;
how to print a sentence out in a string of camel case java
boolean shouldConvertNextCharToLower = true;
how to print a sentence out in a string of camel case java
String[] words = text.split("[\\W_]+");
how to print a sentence out in a string of camel case java
boolean shouldConvertNextCharToLower = true;
how to print a sentence out in a string of camel case java
for (int i = 0; i < text.length(); i++) {
char currentChar = text.charAt(i);
if (currentChar == delimiter) {
shouldConvertNextCharToLower = false;
} else if (shouldConvertNextCharToLower) {
builder.append(Character.toLowerCase(currentChar));
} else {
builder.append(Character.toUpperCase(currentChar));
shouldConvertNextCharToLower = true;
}
}
return builder.toString();
how to print a sentence out in a string of camel case java
StringBuilder builder = new StringBuilder();
for (int i = 0; i < words.length; i++) {
String word = words[i];
if (i == 0) {
word = word.isEmpty() ? word : word.toLowerCase();
} else {
word = word.isEmpty() ? word : Character.toUpperCase(word.charAt(0)) + word.substring(1).toLowerCase();
}
builder.append(word);
}
return builder.toString();
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us