Akhil Sharma has Published 653 Articles

Golang Program to trim a string from the right side

Akhil Sharma

Akhil Sharma

Updated on 17-Feb-2023 15:06:09

663 Views

Strings are a built-in data type that represents sequences of characters in Golang. They are defined using double quotes (") and can contain any valid Unicode characters. In this article we will write a go language program to trim a string from the right side. We will achieve this both ... Read More

Golang Program to convert a string into Uppercase

Akhil Sharma

Akhil Sharma

Updated on 17-Feb-2023 15:04:56

1K+ Views

Strings are a built-in data type that represents sequences of characters in Golang. They are defined using double quotes (") and can contain any valid Unicode characters. In this article we will write a go language program to convert a string to uppercase. Here we will see the usage of ... Read More

Golang Program to trim a string from both sides

Akhil Sharma

Akhil Sharma

Updated on 17-Feb-2023 15:03:34

2K+ Views

Strings are a built-in data type that represents sequences of characters in Golang. They are defined using double quotes (") and can contain any valid Unicode characters. In this article we are going to learn about how to trim a string from both side using Go programming language. Method 1: ... Read More

Golang Program to pad a string with 0's on left side

Akhil Sharma

Akhil Sharma

Updated on 17-Feb-2023 15:02:10

605 Views

In the Go programming language, strings are a built-in data type that represents sequences of characters. They are defined using double quotes (") and can contain any valid Unicode characters. In this article, we are going to learn different techniques to pad a string with 0’s on the left side. ... Read More

Golang Program to get the index of the substring in a string

Akhil Sharma

Akhil Sharma

Updated on 17-Feb-2023 15:00:14

853 Views

In the Go programming language, strings are a built-in data type that represents sequences of characters. They are defined using double quotes (") and can contain any valid Unicode characters. A substring is a portion of a string that contains a sequence of characters from the original string. A substring ... Read More

Golang Program to merge two integer arrays without using library function

Akhil Sharma

Akhil Sharma

Updated on 16-Feb-2023 19:08:54

200 Views

An array in go language is defined as the data structure that is used to store elements in contiguous memory locations. Arrays allow us to search and store elements at constant time. arrays use index to store elements which starts from 0 and goes to n – 1, where n ... Read More

Golang Program to convert int type variables to long

Akhil Sharma

Akhil Sharma

Updated on 16-Feb-2023 19:07:41

774 Views

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

Golang Program to sort an array in descending order using insertion sort

Akhil Sharma

Akhil Sharma

Updated on 16-Feb-2023 19:06:25

356 Views

Insertion sort is a simple sorting algorithm that works similarly to the way you sort playing cards in your hands. The array is virtually split into a sorted and an unsorted part. The elements from unsorted arrays are picked and placed at the correct positions in unsorted arrays, as a ... Read More

Golang Program to cyclically permutes the elements of the array

Akhil Sharma

Akhil Sharma

Updated on 16-Feb-2023 19:01:07

53 Views

Cyclically means that in every cycle we wish to move the array elements by one position till we get the original array again. Cyclic permutation can be useful in various matrix manipulation and linear algebra operations. In this article, we are going to see different examples to permute the elements ... Read More

Golang Program to check a given number is finite or not

Akhil Sharma

Akhil Sharma

Updated on 16-Feb-2023 19:00:37

334 Views

In this article we will write a go language program to check if a given number is finite or not. The program uses IsInf() and IsNaN() library functions in order to check whether numbers are finite or not. Syntax func IsInf(f float64, sign int) bool IsInf() function is present ... Read More

Advertisements