Posts

Showing posts from June, 2020

Difference between Chaining operator(&&) and Literal Operator(&)

Image
Recently I talked about the Chaining Operator(&&) and how it simplifies dealing with texts and strings. I wanted to talk about a similar-looking operator with some similar functions to the chaining operator which makes it easy to confuse each other. A literal operator( & ) is used to join two or more literals to produce a single literal. However, there is a hard character length limit of 255. Example of using a literal operator: There are more features and limitations to a literal operator. Below are the points on which it's similar/different to a Chaining operator.     - Similar to the chaining operator, you can use join string templates using & .     - Any trailing blank in text field literals is preserved, unlike chaining operator.     - Can span multiline:      - Calculated at compile-time.     -  Can not have more than 255 characters(See the error in the above image), if you w