Akhil Sharma has Published 653 Articles

Golang Program to get characters from a string using the index

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 16:39:39

2K+ Views

In Golang, there are various methods to get characters from a string with the help of an index. In this article, we are using external functions as well as by using internal functions defined in the go language. Method 1: Using User-Defined Function In this method, the function that we ... Read More

Golang Program to Display Armstrong Number Between Two Intervals

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 16:35:02

159 Views

An Armstrong number, also known as a narcissistic number, is a number that is equal to the sum of its own digits each raised to the power of the number of digits. Here we will show different approaches about how we can print the Armstrong numbers in go programming language. ... Read More

Golang Program to convert long type variables to int

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 16:32:27

144 Views

In go language, a long is not a separate data type but it is an extension made from the integer data type to store even larger values of integers. The main difference between an int data type and long data type is that an int data type is 32 bits ... Read More

Golang Program to get a substring from the string

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 16:24:19

3K+ Views

A substring in Go is a portion of a larger string. It is specified by providing a start index and a length, and it contains the characters of the original string starting at the start index and going up to the specified length. The characters in a substring are still ... Read More

Golang Program to check the given string is empty or not

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 16:22:52

283 Views

In Go, a string is a sequence of characters. It is an immutable data type, meaning that once a string is created, it cannot be modified. Strings are enclosed in double quotes ("") and can contain any combination of letters, numbers, and symbols. They are commonly used to store text ... Read More

Golang program to find all subsets of a string

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 16:21:25

295 Views

A string in Golang is a collection of characters. Since strings in Go are immutable, they cannot be modified after they have been produced. Concatenating or adding to an existing string, however, enables the creation of new strings. A built-in type in Go, the string type can be used in ... Read More

Golang program to shuffle the elements of an array

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 16:14:16

427 Views

An array is a fixed sequence of elements in which the elements are placed at contiguous memory locations. We will shuffle and randomly place the elements of the array. In the first case we will use fisher-yates shuffle algorithm. Let’s see how we can execute it using different logics in ... Read More

Golang program to compare two strings

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 16:12:08

263 Views

In go programming language, string is one of the data-types that can be used for various application. It is a collection of characters and is also immutable. In go programming language a string can't be modified after they have been created. In this article, we are going to study different ... Read More

Golang program to remove a subset from a slice

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 16:11:33

142 Views

Slice is similar to an array, the only difference is that an array is a fixed sequence of elements whereas slice the array elements are dynamic. This makes the slice more efficient and faster in various applications. In slice, the elements are passed by reference instead of values. In this ... Read More

Golang program to sort a string

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 16:10:08

3K+ Views

A string in Golang is a collection of characters. Since strings in Go are immutable, they cannot be modified after they have been produced. Concatenating or adding to an existing string, however, enables the creation of new strings. A built-in type in Go, the string type can be used in ... Read More

Advertisements