Questions tagged [curly-brackets]

The symbols "{" and "}", commonly used in programming languages. Please use this tag only if the specific usage of these symbols is a relevant part of the question.

The curly brackets (or braces) "{" and "}" are special cases of brackets, along with parentheses and square brackets ("[" and "]").

Curly brackets have many uses in most programming languages, such as:

  • identify code blocks;
  • create lists and arrays;
  • pass arguments to commands in TeX.
82 questions
0
votes
2 answers

Compile error with inner class (bracket expected)

I have an inner listener class in my program. The compiler signals an error at the first line below and says '{' expected. I can't figure out what's wrong. I revised all my brackets and there's no problem. Here's my inner class: private class…
Andrew S.
  • 80
  • 1
  • 10
0
votes
2 answers

Curly Brackets Converted to Hexidecimal when using URL.Document or window.location.href

Would like to take document.URL, find the string with curly brackets, remove the curly brackets, and show just the string that was inside the curly brackets. However, it seems that document.URL or window.location.href convert the curly brackets to…
Usman
  • 41
  • 2
  • 6
0
votes
4 answers

"parse error at end of input", but I'm sure my brackets are correct. (in C)

I'm pretty sure my brackets are matched up correctly, but I'm getting the error "parse error at end of input" No matter how many or few brackets I attach to the end of this program. Since all of the Google results for this error say that the fix…
Megan Rose
  • 23
  • 1
  • 3
  • 5
0
votes
1 answer

Error with my ArrayList Code (Brackets Error)

Currently having an error issue when I compile the file I've been checking my while loops and stuff and see where the issue is but i can't find it It's like the only error showing now (I hope) Hopefully someone can help out on which bracket i am…
aldz24
  • 65
  • 8
0
votes
2 answers

How do I change the style of brackets for a large document?

I'm using a large SCSS document. It's very large. Currently the style looks like this: .class { #inner { h5 { } } } I want it to look like this, I find it much easier to read: .class { #inner { p …
munchschair
  • 1,593
  • 3
  • 19
  • 43
0
votes
4 answers

How to split a string containing {hello}{world} curley brackets but keep the brackets (vb.net)

I'm trying to find a way of splitting a string that contains 2 {}{} brackets but after it's split it keeps the brackets. Before word = {XXXX}{XXXX} After Word(1) = {XXXX} word(2) = {XXXX} I tried using split but this always removes the }{ which…
user6585543
0
votes
1 answer

How do I delineate an empty cell in an array using curly brackets in Google Sheets? (aka Why can't I use "{ , ; "" , "" } In Google Sheets?)

I've found that when I use an array to produce two columns in Google Sheets, it doesn't count the cell in the rightmost column as "empty", and therefore doesn't do the proper "Overflow" text wrapping as it normally would (Text in the left-most…
Josh
  • 311
  • 3
  • 11
0
votes
1 answer

Why does VS2015's intellisense keep leaving the opening bracket after "else"?

This is what makes me mad: See, I press "Format Document" and everything sweetly suits to where it belongs, but after I switched from VS2013 to VS2015, this opening bracket after else never goes to the next line until I manually insert a carriare…
AgentFire
  • 8,944
  • 8
  • 43
  • 90
0
votes
1 answer

Setup Codeformatter for Sublime Text 3 - Allman bracket style

I have installed Codeformatter for Sublime Text 3, because I want the Allman style for curly brackets when I hit tab. However, I cannot seem to figure out how to "activate" this feature, so it auto formats with the allman style (mainly in PHP). Any…
Frederik
  • 637
  • 2
  • 8
  • 21
0
votes
2 answers

Diffrientiation in outputs depending on the ommition of curly braces in for loops (c++)

I have been going through the c++ primer book as suggested by a reference guide on this site and I noticed the author omits curly braces for the for loop.I checked other websites and the braces are supposed to be put in usually. There is a different…
user5699271
0
votes
2 answers

Use scope variables within directive template by using double curly brackets {{}}

I have an array of JSON within my controller, and I want to generate through the use of an ng-repeat several times the use of a directive that I created. Every time it would take the data from the array to pass to the directive by calling a specific…
0
votes
1 answer

Aren't curly brackets the metacharacters in regular expressions in cygwin?

I want to search the phone-number in a text file using grep in cygwin. The number is 0570-2770521, and I use the regular expression "[0-9]{4}-[0-9]{7}" with total command as grep "[0-9]{4}-[0-9]{7}" ./list.txt, but it didn't work. Then I changed…
cmjauto
  • 19
  • 6
0
votes
1 answer

curly brackets - recursion

I've read some previous questions about the use of curly brackets, from my understanding it's ok to not use the curly brackets if you have only one line but if you were to use many lines of code you would need to use brackets. I have an assignment…
0
votes
1 answer

Working with the characters backslash and curly brackets in regular expressions in Python

I am using regular expressions to recognize the lines containing \begin{frame} in .tex files. Below is my code: #!/usr/bin/python import re,sys def isEven(num): res = [False,True][bool(num % 2 == 0)] return res textin =…
Tung
  • 1,579
  • 4
  • 15
  • 32
0
votes
1 answer

java - netbeans- formatting - keep curly brackets on same line?

i would like to keep code like this (and use autoformat): try { System.out.println("oh"); } catch(Exception e) {} try { System.out.println("hey"); } catch(Exception e) {} but netbeans reformats to this: try { System.out.println("oh"); } catch…
stuart
  • 1,785
  • 2
  • 26
  • 38