Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Strings | Data Types
course content

Course Content

Introduction to GoLang

StringsStrings

In Go, strings are sequences of Unicode characters, which essentially means they represent textual data. String data is always enclosed in double quotation marks (") or backticks. The string data type is represented by the string keyword.

go

index.go

Note

A string is a data type in Go, while a string literal refers to the actual representation of a string value within the source code, for example, Hello World.

We can write a string literal in multiple lines by enclosing it in backticks (``). You can see the difference in the following program:

go

index.go

Strings can be joined together using the plus (+) operator:

go

index.go

The process of joining two strings using the (+) operator is called string concatenation.

question-icon

Which of the following is the correct way to declare a string variable in Go?

Select a few correct answers

Everything was clear?

Section 2. Chapter 5
course content

Course Content

Introduction to GoLang

StringsStrings

In Go, strings are sequences of Unicode characters, which essentially means they represent textual data. String data is always enclosed in double quotation marks (") or backticks. The string data type is represented by the string keyword.

go

index.go

Note

A string is a data type in Go, while a string literal refers to the actual representation of a string value within the source code, for example, Hello World.

We can write a string literal in multiple lines by enclosing it in backticks (``). You can see the difference in the following program:

go

index.go

Strings can be joined together using the plus (+) operator:

go

index.go

The process of joining two strings using the (+) operator is called string concatenation.

question-icon

Which of the following is the correct way to declare a string variable in Go?

Select a few correct answers

Everything was clear?

Section 2. Chapter 5
some-alt