Cody

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

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'

Solution Stats

56.1% Correct | 43.9% Incorrect
Last solution submitted on Oct 20, 2016

Problem Comments

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

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Join the 15-year community celebration.

Play games and win prizes!

Learn more