Akhil Sharma has Published 671 Articles

Golang Program to remove all 'nil' elements from the array

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 15:44:10

788 Views

This tutorial is all about how to remove all nil elements from the array. Basically, sometimes there are empty strings present in the array which we want to remove. Here in this tutorial, we will have a look how to remove those strings with the use of very simple methods. ... Read More

Golang program to iterate over a Slice

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 15:38:02

2K+ Views

In this tutorial, we will iterate over a slice using different set of examples. A slice is a dynamic sequence which stores element of similar type. The iterated list will be printed on the console using fmt.Println() function. Method 1:Using for Loop with Index In this method, we will iterate ... Read More

Golang program to fill an array with a specific element

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 15:35:44

2K+ Views

In this tutorial, we will learn how to fill an array with a specific element. We will explore few examples to know more about this program. The output will be printed on console using fmt.Println() function. Let’s have a look and understand the program. We have used the following make() ... Read More

Golang program to find the prime numbers from the array

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 15:31:52

314 Views

In this tutorial, we will showcase how to find the prime numbers from the array using different examples. Prime numbers are those numbers which are either divisible by 1 or by themselves they have no factor other than this. Now we will present you few illustrations to help you get ... Read More

Golang program to fetch elements from an array based on an index

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 15:26:59

679 Views

In this tutorial, we will learn how to fetch elements from an array with the help of index using different examples to showcase what methods can be applied to it and the result obtained will be printed on the console using the print function in Golang. Method 1: Using an ... Read More

Golang Program to remove given element from the array

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 15:25:24

2K+ Views

In this tutorial, we will learn how to remove an element from an array using simple for loop approach. The logic behind this approach is that create a new array and the particular index element which is to be removed don’t add it to the new array. Let’s have a ... Read More

Golang program to illustrate the creation of strings

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 15:21:26

102 Views

In this tutorial, we will see how strings are created in Golang. There are different ways to create strings which we will learn via some examples. In Golang a string is a sequence of variable-width characters where each character is represented by one or more bytes. Method 1: Using double ... Read More

Golang Program to search an item into the array using interpolation search

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 15:17:57

175 Views

In this tutorial, we will see how to search an item in the array using interpolation search. It is very similar to Binary search but is an improved version of it, in this algorithm the element is searched from the sorted array using a different method to find middle element ... Read More

Golang Program to compare strings using library function

Akhil Sharma

Akhil Sharma

Updated on 10-Feb-2023 18:08:18

566 Views

In this article we will write an article to compare numbers and strings using library function in Go language. we will write two programs to illustrate. In the first program we will use the external user defined function and in the second one we will use the internal library function ... Read More

Golang Program to convert boolean variables into string

Akhil Sharma

Akhil Sharma

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

309 Views

In this tutorial, we will learn how to convert Boolean to a string in Go programming language. Boolean is a data type having 1 byte size. It can store any one of the three values mainly True, False or none. String data type is used to store a sequence of ... Read More

Advertisements