1. 转换后的字符串只保留字母[a-zA-Z]和数字[0-9],去除其他字符; 2. 输入字符串中的字母字符的前一字符如非字母或数字,该字母转换后为大写,其他字母转换后为小写; 例外:转换后的字符串第一个字符如果是字母,则该字母转换后为小写; 3. 转换后的字符串保留数字字符。 4. 字符串如果为空或者无[a-zA-Z]和数字[0-9]中字符,请默认输出如下字符串"shopee"
示例1
输入
"hello_world"
输出
"helloWorld"
加载中...
import java.util.*; public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param newString string字符串 * @return string字符串 */ public String camelCase (String newString) { // write code here } }
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param newString string字符串 * @return string字符串 */ string camelCase(string newString) { // write code here } };
#coding:utf-8 # # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param newString string字符串 # @return string字符串 # class Solution: def camelCase(self , newString ): # write code here
using System; using System.Collections.Generic; class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param newString string字符串 * @return string字符串 */ public string camelCase (string newString) { // write code here } }
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param newString string字符串 * @return string字符串 */ function camelCase( newString ) { // write code here } module.exports = { camelCase : camelCase };
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param newString string字符串 # @return string字符串 # class Solution: def camelCase(self , newString ): # write code here
package main import "fmt" /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param newString string字符串 * @return string字符串 */ func camelCase( newString string ) string { // write code here }
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param newString string字符串 * @return string字符串 */ char* camelCase(char* newString ) { // write code here }
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param newString string字符串 # @return string字符串 # class Solution def camelCase(newString) # write code here end end
object Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param newString string字符串 * @return string字符串 */ def camelCase(newString: String): String = { // write code here } }
object Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param newString string字符串 * @return string字符串 */ fun camelCase(newString: String): String { // write code here } }
import java.util.*; public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param newString string字符串 * @return string字符串 */ public String camelCase (String newString) { // write code here } }
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param newString string字符串 * @return string字符串 */ export function camelCase(newString: string): string { // write code here }
public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param newString string字符串 * @return string字符串 */ func camelCase ( _ newString: String) -> String { // write code here } }
struct Solution{ } impl Solution { fn new() -> Self { Solution{} } /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param newString string字符串 * @return string字符串 */ pub fn camelCase(&self, newString: String) -> String { // write code here } }
"hello_world"
"helloWorld"