caps lock, but for underscores
조회 수: 2 (최근 30일)
이전 댓글 표시
My organization's parameter naming convention uses lower case letters and underscores. (ex. this_is_my_parm_name)
It's extremely easy to accidentally use a hyphen instead of an underscore (ex. this_is-my_param_name) when working with our parameters
Is there any way to create a simple to use "caps lock" function just for the hyphen/underscore key?
댓글 수: 1
Adam Danz
2021년 1월 28일
편집: Adam Danz
2021년 1월 28일
> Is there any way to create a simple to use "caps lock" function just for the hyphen/underscore key?
Not in Matlab.
You can use strrep or regexprep to replace dashes with underscores in text but that's entirely different from changing the behavior of the keyboard.
채택된 답변
추가 답변 (1개)
David Hill
2021년 1월 28일
Just run this script after completing your function.
filetext = fileread('yourFunction.m');
newText = strrep(filetext,'-','_');
fid = fopen('yourFunction.m', 'w');
fprintf(fid,' %s\n', newText);
fclose(fid);
댓글 수: 2
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!