logo-MindMajix
PostGoLangGoLang
A
Athiq mohd

Posted on 24th July 2024|42 views

0
votes

Golang String Concatenation

How can I concatenate two strings in Golang?

1 answers
Answers
P
sumana reddy

Posted on 24th July 2024| views

Use += operator to do so, try this example

package main

import "fmt"

func main() {

  1str := "Welcome"

    2str := "mindmajix"

 1str += 2str

    fmt.Println("String: ", 1str)

  1str += "This is to concatinate two strings"

    fmt.Println("String: ", 1str)

 2str += "Portal"

    fmt.Println("String: ", 2str)}

 

Write your answer

STILL GOT QUERIES?

Get a Live FREE Demo

  • Explore the trending and niche courses and learning maps
  • Learn about tuition fee, payment plans, and scholarships
  • Get access to webinars and self-paced learning videos
Name
Course *
Email *
Phone Number