
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Syed Abeed has Published 40 Articles

Syed Abeed
12K+ Views
Strings.Index is a built-in function in Golang that returns the index of the first instance of a substring in a given string. If the substring is not available in the given string, then it returns -1.SyntaxThe syntax of Index() is as follows −func Index(s, substring string) intWhere, s – Original ... Read More

Syed Abeed
4K+ Views
Golang has a built-in string function called Compare() that we can use to compare two strings. Here strings are compared using the lexicographical order.Syntaxfunc Compare(a, b string) intReturn TypesIf the strings (a == b), it returns 0.If the strings (a > b), then it returns 1If the strings (a < ... Read More

Syed Abeed
19K+ Views
ReplaceAll() function in Golang replaces all the occurrences of a given substring with a new value. In contrast, Replace() function is used to replace only some characters in a string with a new value. It replaces only a specified "n" occurrences of the substring.SyntaxThe syntax of ReplaceAll() is as follows ... Read More

Syed Abeed
3K+ Views
The HasSuffix() function of string class in Golang is used to check whether a given string ends with a specified Suffix string or not. It returns True if the given string ends with the specified Suffix string; otherwise it returns False.HasSuffix() and HasPrefix() check if a string ends or starts with a ... Read More

Syed Abeed
4K+ Views
The HasPrefix() function of string class in Golang is used to check whether a given string begins with a specified Prefix string or not. It returns True if the given string begins with the specified prefix string; otherwise it returns False.Syntaxfunc HasPrefix(s, prefix string) boolWhere x is the given string. ... Read More

Syed Abeed
5K+ Views
The strings package of Golang has a Replace() function which we can use to replace some characters in a string with a new value. It replaces only a specified "n" occurrences of the substring.In addition to Replace(), there is a ReplaceAll() function that replaces all the occurrences of a given substring ... Read More

Syed Abeed
949 Views
The strings package of Golang provides a Fields() method, which can be used to split a string around one or more instances of consecutive whitespace characters.The Fields() function splits a given string into substrings by removing any space characters, including newlines. And it treats multiple consecutive spaces as a single space.Syntaxfunc ... Read More

Syed Abeed
678 Views
The EqualFold() function in Golang is an inbuilt function of strings package which is used to check whether the given strings (UTF-8 strings) are equal. The comparison is not case-sensitive. It accepts two string parameters and returns True if both the strings are equal under Unicode case-folding (i.e., case-insensitive), False ... Read More

Syed Abeed
5K+ Views
Count() is a built-in function is Golang that can be used to count the number of non-overlapping instances of a character/string in a string.Syntaxfunc Count(s, sep string) intWhere, s – Original Stringsep – Substring which we want to count.It returns an Integer value.ExampleThe following example demonstrates how you can use ... Read More

Syed Abeed
6K+ Views
Golang has a set of built-in string functions that we can utilize to perform different types of operations on string data. Contains() is such a function that can be used to search whether a particular text/string/character is present in a given string. If the text/string/character is present in the given ... Read More