The Wayback Machine - https://web.archive.org/web/20240204105121/https://www.geeksforgeeks.org/string-data-structure/
Open In App
Related Articles

String in Data Structure

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report

Strings are a fundamental concept in programming and are used to represent text data. In programming, a string is a sequence of characters, such as letters, numbers, and symbols. They are widely used for storing and manipulating textual data in various programming languages.

String in Data Structure

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.

  • Concatenation: Combining two strings to create a new string.
  • Length: Determining the number of characters in a string.
  • Access: Accessing individual characters in a string by index.
  • Substring: Extracting a portion of a string.
  • Comparison: Comparing two strings to check for equality or order.
  • Search: Finding the position of a specific substring within a string.
  • Modification: Changing or replacing characters within a string.

Introduction to 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:


Feeling lost in the world of random DSA topics, wasting time without progress? It's time for a change! Join our DSA course, where we'll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 geeks!


Last Updated : 22 Jan, 2024
Like Article
Save Article
Share your thoughts in the comments
Similar Reads
Complete Tutorials