Sabid Ansari has Published 199 Articles

How to Trim a String in Golang?

Sabid Ansari

Sabid Ansari

Updated on 25-Apr-2023 10:13:54

8K+ Views

In Golang, trimming a string means removing whitespace characters from the beginning and/or end of the string. Trimming can be useful when working with user input, where leading or trailing whitespace may be unintentionally entered. In this article, we will explore how to trim a string in Golang. Using the ... Read More

How to Split Text Using Regex in Golang?

Sabid Ansari

Sabid Ansari

Updated on 25-Apr-2023 10:10:26

1K+ Views

In Golang, splitting text using regular expressions (regex) is a powerful and flexible way to extract information from strings. In this article, we will explore how to split text using regex in Golang. Using the regexp.Split() function Golang provides a built-in regexp package that allows us to work with regex ... Read More

How to Sort Golang Map By Keys or Values?

Sabid Ansari

Sabid Ansari

Updated on 25-Apr-2023 10:02:02

6K+ Views

Go is a powerful programming language that comes with built-in support for maps. Maps are unordered collections of key-value pairs, and sometimes it's necessary to sort them by either their keys or values. Fortunately, Go provides a way to sort maps by both keys and values using the sort package. ... Read More

How to sort a slice stable in Golang?

Sabid Ansari

Sabid Ansari

Updated on 25-Apr-2023 09:58:57

766 Views

When sorting slices of data in Go, sometimes it's important to maintain the original order of elements that have the same sort key. This is where stable sorting comes into play. A stable sort algorithm ensures that the order of elements with the same sort key remains the same after ... Read More

How to sort a slice of ints in Golang?

Sabid Ansari

Sabid Ansari

Updated on 25-Apr-2023 09:55:26

835 Views

Sorting a slice of int values is a common task in many applications, and Go provides a built-in package sort that includes functions to sort slices of any type, including slices of int values. In this article, we will discuss how to sort a slice of int values in Golang. ... Read More

How to sort a slice of float64s in Golang?

Sabid Ansari

Sabid Ansari

Updated on 25-Apr-2023 09:54:25

375 Views

In Go programming language, sorting a slice of float64 values is a common task in many applications. Fortunately, Go provides a built-in package sort that includes functions to sort slices of any type, including slices of float64 values. In this article, we will discuss how to sort a slice of ... Read More

How to sort a slice in Golang?

Sabid Ansari

Sabid Ansari

Updated on 25-Apr-2023 09:52:08

3K+ Views

In Go programming language, a slice is a dynamic array that can hold a sequence of elements of the same type. Slices can be sorted using the built-in sort package. In this article, we will discuss how to sort a slice in Golang. Sorting a slice in Go is simple, ... Read More

How to Remove Duplicate Values from Slice in Golang?

Sabid Ansari

Sabid Ansari

Updated on 25-Apr-2023 09:47:11

4K+ Views

In Golang, a slice is a dynamically-sized array that can store a collection of elements of the same type. Sometimes, you may need to remove duplicate values from a slice to ensure that each element in the slice is unique. In this article, we'll discuss how to remove duplicate values ... Read More

How to Print Specific date-time in Golang?

Sabid Ansari

Sabid Ansari

Updated on 25-Apr-2023 09:37:42

2K+ Views

Go is a programming language that is well-suited for building high-performance, concurrent applications. One of the essential features of any application is the ability to work with date and time. In this article, we will explore how to print specific date-time in Go using the time package. Using the Time ... Read More

Go vs Java

Sabid Ansari

Sabid Ansari

Updated on 18-Apr-2023 13:03:29

207 Views

Go and Java are two popular programming languages used for developing different types of applications. While both languages have their unique features and advantages, there are some key differences between them that developers should consider when deciding which language to use for their projects. In this article, we'll explore the ... Read More

Previous 1 ... 6 7 8 9 10 ... 20 Next
Advertisements