'what does "&" means in java properties file

what does "&" means in java properties file?

for example CopyProjectAction_title = &Copy.

does it equal CopyProjectAction_title = Copy?



Solution 1:[1]

As far as config file concern, this is just string variable which may used in program to split later point of time where it used..

Solution 2:[2]

In a Java properties file the "&" does not have a special meaning - in fact it is just another character like a, b or c. However once the key/value pair is loaded by some application the value containing the "&" can get meaning. For example there is a common usecase when the key describes a menu entry and ampersand is the key to access the entry quickly. There is also a Java Tutorial from Oracle about properties:

https://docs.oracle.com/javase/tutorial/essential/environment/properties.html

Solution 3:[3]

If it is still needed

It seems that for SWT related usage (e.g. Eclipse Preference View & Run Configuration) the "&" char is used to prefix a specific char, making it underline during the rendering and selectable by keybord shortcut alt+char.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Will Mcavoy
Solution 2 Matthias
Solution 3 Matthieu P.