Open In App

String in Data Structure

In data structures, a string is a sequence of characters used to represent text. Strings are commonly used for storing and manipulating textual data in computer programs. They can be manipulated using various operations like concatenation, substring extraction, and comparison.

String in Data Structure

What is a String?

String is considered a data type in general and is typically represented as arrays of bytes (or words) that store a sequence of characters. String is defined as an array of characters. The difference between a character array and a string is the string is terminated with a special character ‘\0’. Some examples of strings are: “geeks” , “for”, “geeks”, “GeeksforGeeks”, “Geeks for Geeks”, “123Geeks”, “@123 Geeks”.

String Data Type:

In most programming languages, strings are treated as a distinct data type. This means that strings have their own set of operations and properties. They can be declared and manipulated using specific string-related functions and methods.



Note: In some languages, strings are implemented as arrays of characters, making them a derived data type.

String Operations:

Strings support a wide range of operations, including concatenation, substring extraction, length calculation, and more. These operations allow developers to manipulate and process string data efficiently.

Below are fundamental operations commonly performed on strings in programming.

Applications of String:

Basics of Strings:

String in different language:

Basic Operations of String:

Binary String:

Substring & Subsequence:

Pattern Searching:

Problems on Palindrome String:

Easy Problems on String:

Medium Problems on String:

Hard Problems on String:


Article Tags :