Curly bracket

Updated: 05/16/2020 by Computer Hope
Curly bracket

Alternatively referred to as an open brace, close brace, and squiggly brackets, curly brackets are found on the same keys as the open bracket ( [ ) and close bracket ( ] ) on US keyboards.

Where are the curly bracket keys on the keyboard?

Below is an overview of a computer keyboard with the open curly bracket and close curly bracket keys highlighted in blue.

Bracket key

How to create an open and close curly bracket

Creating the "{" and "}" symbols on a U.S. keyboard

On English keyboards, the open bracket and close bracket are on the same key as the square bracket keys close to the Enter key. To get a curly bracket, press and hold the Shift key and then press the curly bracket key.

Creating the "{" and "}" symbol on a smartphone or tablet

To create a curly bracket a smartphone or tablet, open the keyboard, go into the numbers (123), then (#+=) or symbols (sym), and tap the "{" or "}" symbol.

How are curly brackets used?

These keys are most commonly used in curly bracket programming languages such as C, Java, Perl, and PHP to enclose groups of statements or for a block of code. Below is an example of how an enclosed statement looks like in Perl.

$value = 0;
do {
$value++;
if ($value >= 10) {
print "Value is equal to or greater than 10. Ending.";
exit;
}
} until ($value >= 100);

In the above example, are two enclosed statements using curly brackets. The first group is the do loop that continues to increase the value of $value variable up to 100. Within that group is the if statement for checking if $value is greater than or equal to 10. Once $value is greater than or equal to 10, it prints a message and exits.

What are the other symbols on the curly bracket keys?

On U.S. keyboards, the curly bracket keys are shared with the square bracket keys, which may be shown next to or below the curly bracket symbols. To create the curly bracket, hold down the Shift key while also pressing the curly bracket key.

Keyboard terms, Programming terms, Square bracket