Question: What can i use to solve this Question? - - allow - builtincameltosnakecaseInstructionsWrite a function that converts a string from camelCase to snake _ case.If
What can i use to solve this Question?allowbuiltincameltosnakecaseInstructionsWrite a function that converts a string from camelCase to snakecase.If the string is empty, return an empty string.If the string is not camelCase, return the string unchanged.If the string is camelCase, return the snakecase version of the string.For this exercise you need to know that camelCase has two different writing alternatives that will be accepted:lowerCamelCaseUpperCamelCaseRules for writing in camelCase:The word does not end on a capitalized letter CamelCasENo two capitalized letters shall follow directly each other CamelCAseNumbers or punctuation are not allowed in the word anywhere camelCaseExpected functionfunc CamelToSnakeCases string stringUsageHere is a possible program to test your function:package mainimport fmtfunc mainfmtPrintlnCamelToSnakeCaseHelloWorldfmtPrintlnCamelToSnakeCasehelloWorldfmtPrintlnCamelToSnakeCasecamelCasefmtPrintlnCamelToSnakeCaseCAMELtoSnackCASEfmtPrintlnCamelToSnakeCasecamelToSnakeCasefmtPrintlnCamelToSnakeCaseheyAnd its output:$ go run HelloWorldhelloWorldcamelCaseCAMELtoSnackCASEcamelToSnakeCasehey
dont use import to solve the question
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
