Akhil Sharma has Published 671 Articles

Golang program to demonstrate the string interpolation

Akhil Sharma

Akhil Sharma

Updated on 20-Feb-2023 15:33:10

2K+ Views

In Go programming language, string interpolation is the process of integrating expressions into a string literal. When it's necessary to include dynamic values in strings for log statements, error messages, and other purposes, string interpolation is frequently used. We will use two methods in this program to demonstrate string interpolation. ... Read More

Golang program to create a string object

Akhil Sharma

Akhil Sharma

Updated on 20-Feb-2023 15:31:01

390 Views

In Golang, a string cannot be modified after they have been created. A built-in type in Go, the string type can be used in a variety of ways much like any other data type. In this article, we will use three methods to create a string object. The first method ... Read More

Golang program to convert vector to a list

Akhil Sharma

Akhil Sharma

Updated on 20-Feb-2023 15:29:15

664 Views

In Golang, a vector is referred to as an array or a slice. Slice is a dynamic array whose size can be changed whereas a linked list data structure is one type of list, where each node has a value and is pointing to the next element. We will use ... Read More

Golang program to convert primitive types to objects

Akhil Sharma

Akhil Sharma

Updated on 20-Feb-2023 15:23:48

693 Views

In this Golang program, converting primitive data types (such as int, char, float, etc) to objects is known as "Boxing". It is a procedure that transforms a primitive type into the matching object type, such as an integer into a float, a character into a char, etc. This enables the ... Read More

Golang program to call one constructor from another

Akhil Sharma

Akhil Sharma

Updated on 20-Feb-2023 15:22:35

594 Views

In Go programming language, a constructor is a specific kind of function used to initialize an object's state when it is initially formed. It is used to initialize variables and provide data for the objects. We will execute this program using two methods and we will use struct in both ... Read More

Golang Program to Check Whether the Given String is Pangram

Akhil Sharma

Akhil Sharma

Updated on 20-Feb-2023 10:54:12

375 Views

In this article, we will understand different golang examples to check whether a given string is pangram. A statement known as a pangram uses each letter of the alphabet at least once. A pangram is a string in the programming language Golang that contains every letter of the alphabet, regardless ... Read More

Golang program to implement switch statement on a strings

Akhil Sharma

Akhil Sharma

Updated on 20-Feb-2023 10:52:47

457 Views

A switch statement in Golang is a control flow statement that enables you to run one block of Example: in response to various situations. Similar to if-else expressions, it can test several conditions more quickly. In this article, we will see how switch statement is implemented on strings in Go. ... Read More

Golang program to find the duplicate characters in the string

Akhil Sharma

Akhil Sharma

Updated on 20-Feb-2023 10:50:32

1K+ Views

In golang, identifying characters that appear more than once in a string is the first step in finding duplicate characters. To accomplish this, iterate through the string while keeping track of the characters that have already been encountered. Then, before adding a character, determine if it is already in the ... Read More

Golang program to reverse a string using stacks

Akhil Sharma

Akhil Sharma

Updated on 20-Feb-2023 10:49:36

274 Views

In this article, we will see how to reverse a string using stacks with Go Programming. A stack is a Last In First Out (LIFO) compliant data structure in Go. This implies that the first element to be eliminated will be the one that was most recently added to the ... Read More

Golang program to remove all whitespaces from a string

Akhil Sharma

Akhil Sharma

Updated on 20-Feb-2023 10:47:10

4K+ Views

When we remove whitespaces from a string it means removing blank spaces, tabs, and other white space characters, including newline characters. This can be helpful for parsing user input or working with data in a particular format, among other instances where we wish to clean up or standardize a string ... Read More

Advertisements