简体   繁体   English

蚀快捷方式将字符串值提取到局部变量

[英]eclipse shorcut to extract string value to local variable

String test = var1 + "something";

what is the shortcut to extract "something" into variable? 将“某物”提取到变量中的快捷方式是什么? Searched in SO but found no question related to this. 在SO中搜索,但没有与此相关的问题。

Select the String including the double quotes and hit Alt + Shift + L 选择包含双引号的字符串,然后Alt + Shift + L

See Extract Local Variable at List of eclipse key bindings for reference 请参阅eclipse键绑定列表中的提取局部变量以供参考

select the value with double quotes and then press ctrl+1 选择带双引号的值,然后按ctrl+1

or go to 或去

Refactor -> Extract local variable

Ctr+L,2

Assume you have done the following "".length() and want to store the result in an integer go anywhere on the instruction "".length() and press Ctrl+L a small window on the right bottom of the screen will open. 假设您已完成以下"".length()并希望将结果存储在指令"".length()上任意位置的整数中,然后按Ctrl+L ,则会在屏幕右下方打开一个小窗口。 Press L after that. 之后按L

Please note it is not case sensitive. 请注意,它不区分大小写。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM