
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
Found 26504 Articles for Server Side Programming

289 Views
Regular expressions are used for pattern matching in programming, and they often contain metacharacters that have special meanings. When creating a regular expression pattern, it is important to consider the metacharacters that are used and escape them if necessary. In Golang, strings are a sequence of bytes that represent Unicode characters. In this article, we will discuss how to create a string that contains regexp metacharacters in Golang. Creating a String that Contains Regexp Metacharacters To create a string that contains regexp metacharacters in Golang, we need to escape the metacharacters that we want to include in the string. We ... Read More

733 Views
Regular expressions are an essential aspect of programming, and they are widely used for pattern matching in various programming languages, including Golang. In Golang, strings are a sequence of bytes that represent Unicode characters. In this article, we will discuss how to check a string for the specified regular expression in Golang. Checking String for Regular Expression To check a string for the specified regular expression in Golang, we can use the "regexp" package. This package provides functions for compiling, matching, and replacing regular expressions. The "regexp" package provides a function called "Compile" that takes a string as input and ... Read More

495 Views
Regular expressions are an essential aspect of programming, and they are widely used for pattern matching in various programming languages, including Golang. The byte slice is a data type that is used to represent sequences of bytes in Golang. In this article, we will discuss how to check the byte slice for a specified regular expression in Golang. Checking Byte Slice for Regular Expression To check the byte slice for a specified regular expression in Golang, we can use the "regexp" package. This package provides functions for compiling, matching, and replacing regular expressions. The "regexp" package provides a function called ... Read More

15K+ Views
In Python, the spaces of a string with a special character can be replaced using replace() method. The replace method replaces all occurrences of the passed substring with a new substring. In this article, we will see how we can use replace() method to replace the spaces of a string with another specific substring. Syntax of Replace Method The syntax of the replace method is as follows − string.replace(old, new[, count]) The replace method takes two inputs, one is the old string which is the substring you want to replace and another input is the new string which is ... Read More

3K+ Views
In Python, we can open a file in a read-write mode without truncating the file by opening the file in a+ mode. Truncating a file refers to deleting the existing content of the file before opening the file. In this article, we will discuss how we can open the file in the read-write mode without truncating the file. What is a+ mode The a+ mode in Python is used to open the file in a read-write mode without truncating the file. When the file is opened in a+ mode it allows us to write new data at the end of ... Read More

2K+ Views
In Python, we can open a file in read-write mode by truncating the file by opening the file in w+ mode. Truncating a file refers to deleting the existing content of the file before opening the file. In this article, we will discuss how we can open the file in the read-write mode by truncating the file. What is the w+ mode The w+ mode in Python is used to open the file in read-write mode with file truncation. When the file is opened in w+ mode it allows us to read and write data in the file. If the ... Read More

10K+ Views
Enum in Python is a user-defined data type consisting of a set of named values. A finite set values of is defined using enums and these values can be accessed in Python using their names instead of their integer values. Enum makes the code more readable, and more maintainable and also enforces type safety. In this article, we will see how we can look up enums by their string value in Python. To look up an enum by string value we need to follow the following steps: Import enum module in the code Define enum with desired set of ... Read More

11K+ Views
In Python, we can insert a string into another string using the string concatenation method, string interpolation method, and using replace() method. Python provides various ways to insert a string into another string. In this article, we will understand all the methods with the help of suitable examples. Method 1: Using the Concatenation Operator String concatenation simply joins two strings together using the (+) operator. Any number of strings can be concatenated using this method in a simple and effective way. Example In the below example, we initialized three strings namely string1, string2, and inserted_string. We need to insert the ... Read More

3K+ Views
In Python, we can implement switch statements on a string using the dictionary-based approach, class-based approach, and lambda-based approach. Unlike other programming languages like Java, c++, etc python does not have an inbuilt switch statement. In this article, we will see how we can achieve the switch statement functionality in Python using a dictionary-based approach and class-based approach, and lambda-based approach. The Switch Statement in Other Programming Languages Before understanding how Python implements switch statements we need to understand how to switch statements work and how they are implemented in other programming languages. A switch statement is a conditional statement ... Read More

2K+ Views
In Python we can use the find() and index() methods to get the index of the first occurrence of the substring in a string. Python provides various string manipulation functions to modify and access text data. In this article, we will write a program to get the index of the substring in a string. Method 1: Using the find() method The find method searches for the specific substring which is passed as a parameter to the function and returns the starting index of the substring. If the substring is not found in the string then the find() method returns -1. ... Read More