replacing string in a string golang code example
Example 1: replace string in typescript
var re = /apples/gi;
var str = "Apples are round, and apples are juicy.";
var newstr = str.replace(re, "oranges");
console.log(newstr)
Example 2: concatenate a string in golang
// Creating and initializing strings
// Using shorthand declaration
str3 := "Geeks"
str4 := "Geeks"
// Concatenating strings
// Using + operator
result := str3 + "for" + str4
fmt.Println("New string 2: ", result)