Skip to content

String with single or double quotes? #19

@SimonLab

Description

@SimonLab

You can represent a string with either single quotes or double quotes without any difference.

const hello1 = "hello";
const hello2 = 'hello';
hello1 == hello2; //true

To escape specific characters in a string use \

Dart style guide let you decide which one you prefer to use, just be consistent.
Flutter style guide recommend to use single quote: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#prefer-single-quotes-for-strings

ref:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions