Answers for "how to convert string to camel case java"

2

Convert string to camel case

def to_camel_case(text):
    if text == '':
        return text
    for i in text:
        if i == '-' or i == '_':
            text = text.replace(text[text.index(i):text.index(i)+2], text[text.index(i)+1].upper(), 1)
    return text
Posted by: Guest on April-04-2021
0

Java camel case

import java.util.Arrays;

class Solution {
  public static String camelCase(String input) {
    return input.replaceAll("([A-Z])", " $1");
  }
}
Posted by: Guest on June-07-2021

Code answers related to "how to convert string to camel case java"

Browse Popular Code Answers by Language