[21] Results

Golang : How to join strings?

golang join combine strings

Apart from using fmt.Sprint() function to combine strings together. There is another way to concatenate string from different strings. One….... read more

Golang : How to check if a string contains another sub-string?

golang strings contains

Problem :

How to check if a string contains another sub-string in Golang?

Solution :

Use the strings.Contains() function.

.... read more

Golang : Check if a string contains multiple sub-strings in []string?

golang strings contains filter sub-strings

Problem :

You have a string and you use strings.Contains() function to determine if there is a sub-string inside the….... read more

Golang : Strings comparison

golang strings comparison equalfold

Given that mostly backend services deal with text data. There bound to be times when there is a need to….... read more

Golang : Find the shortest line of text example

golang shortest-line strings-split

Continue from previous tutorial on how to find the longest line in a given text. This example demonstrates how to….... read more

Golang : Transform comma separated string to slice example

golang comma-separated strings slice

Got a request from a junior software developer from India. Her question is how to convert a given comma-separated string….... read more

Golang : How to get username from email address

golang stringsextract-username email-address

Just need a simple solution to extract the username from a given email address. The code below uses strings.Split() function….... read more

Golang : Repeat a character by multiple of x factor

golang python strings-repeat multiply-letters

In Python, it is pretty easy to repeat some characters inside a string. All you need to do is to….... read more