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
Problem Comments
3 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers29
Suggested Problems
-
Determine whether a vector is monotonically increasing
22904 Solvers
-
Remove any row in which a NaN appears
8771 Solvers
-
Replace NaNs with the number that appears to its left in the row.
3064 Solvers
-
Create matrix of replicated elements
397 Solvers
-
Create a two dimensional zero matrix
525 Solvers
More from this Author25
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
ur test suites gave me headache..
u jumbled upper and lower case
When designing a program, Swapnali, it is important to follow a pattern, or else you may endup with spaghetti code (it will have so many rules for so many cases that no one will know what it does or why). This means that If words start with an uppercase letter, then all words must start with an uppercase letter. If the first letter of a phrase is in lowercase, then all first letters from all phrases should be in lowercase.
The pattern depends on the "special character".