[26] Results

Golang : Remove characters from string example

golang strip-charactersindex-rune strings map


You have a string and you want to remove certain characters from the string base on a set of….... read more

Golang : Skip or discard items of non-interest when iterating example

golang read-file skip-iterable-item strings-index


You want to skip or discard items of non-interest when iterating. For example, skipping the commented lines with #.... read more

Golang : Simple file scaning and remove virus example

file-scanning anti-virus bytes-reader strings-index signature

Just for fun, for this tutorial, we will simulate a simple anti-virus program. Let's create a simple file scanner that….... 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 : 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 : Calculate US Dollar Index (DXY)

golang forex-trading us-dollar-index dxy

Below is a code example on how to calculate the US dollar index based on a basket of other related….... 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 : 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