caps lock, but for underscores
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Conor Sullivan
el 28 de En. de 2021
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 comentario
Adam Danz
el 28 de En. de 2021
Editada: Adam Danz
el 28 de En. de 2021
> 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.
Respuesta aceptada
Más respuestas (1)
David Hill
el 28 de En. de 2021
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 comentarios
Ver también
Categorías
Más información sobre Line Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!