Are quotes a type of string delimiter? Or does 'delimiter' mean other types of characters not including quotes?

StackOverflow https://stackoverflow.com/questions/652518

  •  19-08-2019
  •  | 
  •  

Question

When people talk about string delimiters, does that include quotes or does that mean everything except quotes?

Was it helpful?

Solution

It means any character used to define the beginning and end of a string (e.g. quotes but, in other contexts, other characters).

OTHER TIPS

There's a subtle difference, if you're talking about string delimiters that nearly always means quotes, either " or '.

If you're talking about a delimited string, then you're normal talking about a string of tokens, with delimiters between them ie

"this,is,a,delimited,string" -

It's very common to use a comma, as the delimiter, but that leads to issues when the token already contains a comma - for instance

"one,million,dollars,$1,000,000"

In this instance it's common to further delimit the token so we get

"one,million,dollars,"$1,000,000""

another common alternative is to use an unusual character as the delimiter, and there's a minor convention to use the pipe symbol |

"one|million|dollars|$1,000,000"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top