Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Problem 2216. Given an input string, generate a variable name out of it

Created by Swapnali Gujar

Given an input string, generate a variable name out of it in easy to read format by a programmer.

If the input string contains any special character other than ('_'), replace it with ('_') and then return it in readable format variable name.

Example

 input = 'this is an input var'
 output = 'thisIsAnInputVar'

Another example

 input = 'this one has special char @123'
 output = 'thisOneHasSpecialChar_123'

Tags

Problem Group

Solution Statistics

15 correct solutions 7 incorrect solutions
Last solution submitted on Aug 02, 2014

Problem Comments