image thumbnail

Convert Naming Convention

version 3.1 (54.6 KB) by Moses
Convert from snake case to camel/pascal case and vice versa.

9 Downloads

Updated30 Oct 2021

From GitHub

View license on GitHub

View spider_plot on File Exchange

Convert Naming Convention

Convert from snake case to camel/pascal case and vice versa.

Snake Case to Camel Case

句法:

  • camelCase = snake2camel(snake_case)
  • camelCase = snake2camel (snake_case,名字,瓦尔ue)

Input Arguments:

  • snake_case- Input text in snake case. [string array | character vector | cell array of character vectors]

Name-Value Pair Arguments:

  • FirstLetter- 用于将第一个字母设置为较低或大写。['较低'(默认),'上']

Examples:

%Example 1: Convert from snake case to camel casesnake_case=["num_files","多变的_name","some_function"]; camelCase=snake2camel(snake_case);%Example 2: Convert from snake case to pascal casesnake_case=["num_files","多变的_name","some_function"]; PascalCase=snake2camel(snake_case,'FirstLetter','upper');

Camel Case to Snake Case

句法:

  • snake_case = camel2snake(camelCase)

Input Arguments:

  • camelCase- Input text in camel case. [string array | character vector | cell array of character vectors]

Examples:

%Example 1: Convert from camel case to snake casecamelCase=["nFiles","VariableName","someFunction"]; snake_case=camel2snake(camelCase);

Author:

  • Moses Yoo, (juyoung.m.yoo at gmail dot com)

Special Thanks

Special thanks to Stephen for showing and explaining the much simpler regular expression version!

View spider_plot on File Exchange

Cite As

Moses (2022).Convert Naming Convention(https://github.com/NewGuy012/convert-naming-convention/releases/tag/3.1), GitHub. Retrieved.

MATLAB Release Compatibility
Created with R2021b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
To view or report issues in this GitHub add-on, visit theGitHub Repository.
To view or report issues in this GitHub add-on, visit theGitHub Repository.