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

New to MATLAB?

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

19 correct solutions 10 incorrect solutions
Last solution submitted on May 21, 2015

Problem Comments