Akhil Sharma has Published 671 Articles

Golang Program to Convert String to an Array

Akhil Sharma

Akhil Sharma

Updated on 16-Feb-2023 18:18:48

5K+ Views

In Go Language, we have various data types to store data and the String data type is the one that is used to store a sequence of characters. The size of string variable is 1 or 8 bits. An array on the other hand is a data type that is ... Read More

Golang Program to Print object of a class

Akhil Sharma

Akhil Sharma

Updated on 16-Feb-2023 18:12:04

617 Views

What is the Object of a Class? Object stores Key-value pairs of data together. There are numerous methods for producing an object. Some of them will be covered in this post. In this article, we are going to use two different methods to print objects of a class in the ... Read More

Golang Program to Show Usage of Access Modifier

Akhil Sharma

Akhil Sharma

Updated on 16-Feb-2023 18:07:30

674 Views

In go programming language, there are two types of access modifiers i.e Exported and un-exported. Identifiers that are exported from the package in which they are specified are known as exported identifiers. They always begin with a capital letter. These are only valid in the package in which they are ... Read More

Golang Program to Convert String to Object

Akhil Sharma

Akhil Sharma

Updated on 16-Feb-2023 18:04:45

2K+ Views

In Golang program, a string is a data type that contains literals and characters whereas an object is a data type created from classes by keeping similar types of properties together. In this article, we will look at two methods by which we can convert a string to an object ... Read More

Golang Program to check a string contains a specified substring or not

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 17:05:39

4K+ Views

What is a string and a substring? 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. ... Read More

Golang Program to demonstrate the string concatenation

Akhil Sharma

Akhil Sharma

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

113 Views

What is String Concatenation? In Go, string concatenation is the process of combining two or more strings into a single string. There are several ways to concatenate strings in Go. We shall discuss them in this article. Method 1: By Using User-Defined Function The function that we create will ... Read More

Golang Program to demonstrate the escape sequence characters

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 16:56:04

1K+ Views

In the go programming language, there are several types of special escape sequence characters. Usage of each one of them implements a different type of functionality. We shall discuss each one of them one by one in the upcoming examples. Example 1 In this example, we will write a go ... Read More

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

1K+ 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 find the length of a string

Akhil Sharma

Akhil Sharma

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

1K+ Views

What is string in golang? 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 ... 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

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

Advertisements