Akhil Sharma has Published 634 Articles

Golang Program to demonstrate the example to write double quotes in a string

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 16:49:40

2K+ Views

In Golang there are various techniques of printing double-quotes in the string. In this article, we are going to learn those techniques with various example. Syntax func Quote(s string) string Quote() function is present in strconv() package and is used to add a given string literal in double quotes. ... Read More

Golang Program to get characters from a string using the index

Akhil Sharma

Akhil Sharma

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

5K+ 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

419 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 check the given string is empty or not

Akhil Sharma

Akhil Sharma

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

2K+ 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

883 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

1K+ 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 remove a subset from a slice

Akhil Sharma

Akhil Sharma

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

585 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

7K+ 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 rotate elements of a slice

Akhil Sharma

Akhil Sharma

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

722 Views

A slice is a sequence of elements just like an array. An array is a fixed sequence of elements whereas a slice is a dynamic array, which means its value is not fixed and can be changed. Slices are more efficient and faster than arrays moreover; they are passed by ... Read More

Golang program to check if a set is the subset of another slice

Akhil Sharma

Akhil Sharma

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

2K+ Views

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

Advertisements