Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • C# Data Types
  • C# Decision Making
  • C# Methods
  • C# Delegates
  • C# Constructors
  • C# Arrays
  • C# ArrayList
  • C# String
  • C# Tuple
  • C# Indexers
  • C# Interface
  • C# Multithreading
  • C# Exception
Open In App
Next Article:
JavaScript String Methods
Next article icon

C# Strings

Last Updated : 04 Mar, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

In C#, a string is a sequence of Unicode characters or an array of characters. The range of Unicode characters will be U+0000 to U+FFFF. The array of characters is also termed as the text. So the string is the representation of the text. A string is an important concept, and sometimes people get confused about whether the string is a keyword, an object, or a class. So, let’s clear out this concept.

A string is represented by the class System.String. The “string” keyword is an alias for System.String class, and instead of writing System.String one can use String, which is a shorthand for System.String class. So we can say that both string and String can be used as an alias of System.String class. So string is an object of System.String class.

Example:

// creating the string using string keyword
string s1 = “GeeksforGeeks”;  

// creating the string using String class
String s2 = “GFG”;  

// creating the string using String class
System.String s3 = “Pro Geek”;  

The String class is defined in the .NET base class library. In other words, a String object is a sequential collection of System.Char objects, which represent a string. The maximum size of String object in memory is 2GB or about 1 billion characters. System.String class is immutable, i.e, once created, its state cannot be altered.

C#
// C# program to declare string using // string, String and System.String // and initialization of string using System;  class Geeks  {     // Main Method     static void Main(string[] args)     {         // declare a string Name using          // "System.String" class         System.String Name;                  // initialization of String         Name = "Geek";          // declare a string id using          // using an alias(shorthand)          // "String" of System.String         // class         String id;                  // initialization of String         id = "33";          // declare a string mrk using          // string keyword         string mrk;                  // initialization of String         mrk = "97";                  // Declaration and initialization of         // the string in a single line         string rank = "1";          // Displaying Result         Console.WriteLine("Name: {0}", Name);         Console.WriteLine("Id: {0}", id);         Console.WriteLine("Marks: {0}", mrk);         Console.WriteLine("Rank: {0}", rank);     } } 

Output
Name: Geek Id: 33 Marks: 97 Rank: 1 

Key Characteristics of Strings

  • Immutable: Once created, the content of a string cannot be altered. Any modification results in the creation of a new string.
  • Reference Type: Strings are reference types, but they behave like value types in some scenarios, such as comparison.
  • Unicode Support: Strings can contain any Unicode character, allowing support for multiple languages.
  • Null and Embedded Nulls: Strings can be null and may also contain embedded null characters (\0).
  • Operator Overloading: Strings support operator overloading, such as + for concatenation and == for comparison.

String Class Properties: The String class has two properties as follows:

  • Chars: It is used to get the Char object at a specified position in the current String object.
  • Length: It is used to get the number of characters in the current String object. To know more about the string class properties please go to String Properties in C#.

Reading String from User-Input

A string can be read out from the user input. ReadLine() method of console class is used to read a string from user input.

Example:

C#
// C# program to demonstrate Reading  // String from User-Input using System;  class Geeks  {         // Main Method     static void Main(string[] args)     {          Console.WriteLine("Enter the String");              // Declaring a string object read_user          // and taking the user input using          // ReadLine() method         String read_user = Console.ReadLine();              // Displaying the user input         Console.WriteLine("User Entered: " + read_user);      }      } 

Input:

Hello Geeks !

Output:

User Entered: Hello Geeks !

Different Ways to Create Strings

Method

Syntax / Example

Create a string from a literal

string str = “GeeksforGeeks”;

Create a string using concatenation

string str = str1 + “data”;

Create a string using a constructor

// Create a string from a character array
char[] chars = { ‘G’, ‘E’, ‘E’, ‘K’, ‘S’ };
string str = new string(chars);

Create a string using a property or a method

// start and end are the index for str index
string substr = str.Substring(start, end);

Create a string using formatting

string str = string.Format(“{0} {1} Cars color ” + “are {2}”, no.ToString(), cname, clr);

Example:

C#
// Different Methods for Creating // String in C# using System;  public class GFG {   	// Main Method     static public void Main ()     {              	// Creating String using string literal     	String str = "Geeks";       	Console.WriteLine("Method 1: " + str);              	// Creating String using concatenation       	String str2 = str + "ofGeeks";       	Console.WriteLine("Method 2: " + str2);       	       	// Creating a string using a constructor       	char[] chars = { 'G', 'E', 'E', 'K', 'S' }; 		string str3 = new string(chars);       	Console.WriteLine("Method 3: " + str3);       	       	// Creating a string using a property or a method       	String s = "Geeks For Geeks";       	       	// Index of          int start = s.IndexOf(" ") + 1;       	int end = s.IndexOf(" ", start) - start;       	string str4 = s.Substring(start, end);       	Console.WriteLine("Method 4: " + str4);              	// Creating a string using formatting       	int i=1;       	int j=2;       	int sum= i + j;       	String str5 = string.Format("Addition of {0} with {1} is {2}"                                     , i , j , sum );       	Console.WriteLine("Method 5: " + str5);       	     } } 

Output
Method 1: Geeks Method 2: GeeksofGeeks Method 3: GEEKS Method 4: For Method 5: Addition of 1 with 2 is 3 

C# String Operations

There are multiple String Operations which we can perform in String in C#. Let us demonstrate the operations using the example as mentioned below:

Example 1: For performing string operation of interpolation

C#
using System;  public class GFG {   	// Main Method     static public void Main ()     {         string name = "GeeksforGeeks";                  // Interpolation is performed         string res = $"{name} is the Organisation Name.";                  // Printing the String         Console.WriteLine(res);         Console.WriteLine("Length: " + res.Length);     } } 

Output
GeeksforGeeks is the Organisation Name. Length: 39 


Example 2: for performing trim, replace and concatenate operation

C#
using System;  public class GFG {     static public void Main ()     {         string first = " GeEks ";         string second = " forGeeks ";                  // trim the String         first=first.Trim();         second=second.Trim();                  // Checking element at index 2 first         Console.WriteLine("Element at index 2: " + first[2]);                  // replacing the element in String         first=first.Replace("E","e");         Console.WriteLine(first+second);     } } 

Output
Element at index 2: E GeeksforGeeks 

In the above, two example we have explored many methods we are not full aware of so, there is a list of Methods associated with Strings in C# attached below.

Methods of C# String

Method

Description

Return Type

Example

IndexOf

Finds the index of the first occurrence of a specified character or substring.

Integer

text.IndexOf(“World”);

StartsWith

Checks if a string starts with a specified substring.

Boolean

text.StartsWith(“Hello”);

EndsWith

Checks if a string ends with a specified substring.

Boolean

text.EndsWith(“World!”);

ToUpper

Converts a string to uppercase.

String

text.ToUpper();

ToLower

Converts a string to lowercase.

String

text.ToLower();

Split

Splits a string into an array based on a specified delimiter.

String Array

fruits.Split(‘,’);

Join

Combines an array of strings into a single string with a specified delimiter.

String

string.Join(” – “, fruitArray);

Contains

Checks if a string contains a specified substring.

Boolean

text.Contains(“World”);

PadLeft

Pads a string with spaces or a specified character to a certain length.

String

text.PadLeft(20, ‘*’);

PadRight

Pads a string on the right with spaces or a specified character to a certain length.

String

text.PadRight(20, ‘*’);

Remove

Removes characters from a string starting at a specified index.

String

text.Remove(5, 7);

Insert

Inserts a string at a specified index.

String

text.Insert(5, ” Beautiful”);

Trim

Removes leading and trailing whitespaces.

String

text.Trim();

Replace

Replaces occurrences of a substring with another substring.

String

text.Replace(“fun”, “awesome”);

String Arrays

We can also create the array of string and assigns values to it. The string arrays can be created as follows:

String [] array_variable  =  new  String[Length_of_array]

Example:

C#
// C# program for an array of strings using System;  class Geeks  {        // Main Method    static void Main(string[] args)    {       	String[] str_arr = new String[3];          // Initialising the array of strings         str_arr[0] = "Geeks";         str_arr[1] = "For";         str_arr[2] = "Geeks";          // printing String array         for(int i = 0; i < 3; i++) {             Console.WriteLine("value at Index position " + i                               + " is " + str_arr[i]);         }      } } 

Output
value at Index position 0 is Geeks value at Index position 1 is For value at Index position 2 is Geeks 

String vs System.String 

Aspectsstring (Keyword)System.String (Class)
DefinitionAlias for System.String.Fully qualified class name in .NET.
PerformanceNo difference in performance.No difference in performance.
UsageCommonly used for declaring variables, fields, and properties.Used for accessing static methods or fully qualifying types.
Ease of UseProvides a shorthand for writing code.More verbose but functionally identical to string.
Accessing MethodsMethods are accessed via the System.String class.Static methods like String.Substring, String.IndexOf, etc., are accessed directly.
Keyword or ClassC# keyword..NET class.

Note: In .NET, the text is stored as a sequential collection of the Char objects so there is no null-terminating character at the end of a C# string. Therefore a C# string can contain any number of embedded null characters (‘\0’). 



Next Article
JavaScript String Methods

M

Mithun Kumar
Improve
Article Tags :
  • C#
  • CSharp-string

Similar Reads

  • String in Data Structure
    A string is a sequence of characters. The following facts make string an interesting data structure. Small set of elements. Unlike normal array, strings typically have smaller set of items. For example, lowercase English alphabet has only 26 characters. ASCII has only 256 characters.Strings are immu
    3 min read
  • Introduction to Strings - Data Structure and Algorithm Tutorials
    Strings are sequences of characters. The differences between a character array and a string are, a string is terminated with a special character ‘\0’ and strings are typically immutable in most of the programming languages like Java, Python and JavaScript. Below are some examples of strings: "geeks"
    7 min read
  • Applications, Advantages and Disadvantages of String
    The String data structure is the backbone of programming languages and the building blocks of communication. String data structures are one of the most fundamental and widely used tools in computer science and programming. They allow for the representation and manipulation of text and character sequ
    6 min read
  • String, Subsequence & Substring
    What is a Substring? A substring is a contiguous part of a string, i.e., a string inside another string. In general, for an string of size n, there are n*(n+1)/2 non-empty substrings. For example, Consider the string "geeks", There are 15 non-empty substrings. The subarrays are: g, ge, gee, geek, ge
    6 min read
  • Storage for Strings in C
    In C, a string can be referred to either using a character pointer or as a character array. Strings as character arrays [GFGTABS] C char str[4] = "GfG"; /*One extra for string terminator*/ /* OR */ char str[4] = {‘G’, ‘f’, ‘G’, '\0'}; /* '\0' is string terminator */ [/GFGTA
    5 min read
  • Strings in different language

    • Strings in C
      A String in C programming is a sequence of characters terminated with a null character '\0'. The C String is work as an array of characters. The difference between a character array and a C string is that the string in C is terminated with a unique character '\0'. DeclarationDeclaring a string in C
      6 min read

    • std::string class in C++
      C++ has in its definition a way to represent a sequence of characters as an object of the class. This class is called std:: string. The string class stores the characters as a sequence of bytes with the functionality of allowing access to the single-byte character. String vs Character ArrayString Ch
      8 min read

    • String Class in Java
      A string is a sequence of characters. In Java, objects of the String class are immutable, which means they cannot be changed once created. In this article, we are going to learn about the String class in Java. Example of String Class in Java: [GFGTABS] Java // Java Program to Create a String import
      7 min read

    • Python String
      A string is a sequence of characters. Python treats anything inside quotes as a string. This includes letters, numbers, and symbols. Python has no character data type so single character is a string of length 1. [GFGTABS] Python s = "GfG" print(s[1]) # access 2nd char s1 = s + s[0] # updat
      6 min read

    • C# Strings
      In C#, a string is a sequence of Unicode characters or an array of characters. The range of Unicode characters will be U+0000 to U+FFFF. The array of characters is also termed as the text. So the string is the representation of the text. A string is an important concept, and sometimes people get con
      8 min read

    • JavaScript String Methods
      JavaScript strings are the sequence of characters. They are treated as Primitive data types. In JavaScript, strings are automatically converted to string objects when using string methods on them. This process is called auto-boxing. The following are methods that we can call on strings. slice() extr
      12 min read

    • PHP Strings
      In PHP, strings are one of the most commonly used data types. A string is a sequence of characters used to represent text, such as words and sentences. Strings are enclosed in either single quotes (' ') or double quotes (" "). You can create a string using single quotes (' ') or double quotes (" ").
      4 min read

    Basic operations on String

    • Searching For Characters and Substring in a String in Java
      Efficient String manipulation is very important in Java programming especially when working with text-based data. In this article, we will explore essential methods like indexOf(), contains(), and startsWith() to search characters and substrings within strings in Java. Searching for a Character in a
      5 min read

    • Reverse a String – Complete Tutorial
      Given a string s, the task is to reverse the string. Reversing a string means rearranging the characters such that the first character becomes the last, the second character becomes second last and so on. Examples: Input: s = "GeeksforGeeks"Output: "skeeGrofskeeG"Explanation : The first character G
      14 min read

    • Left Rotation of a String
      Given a string s and an integer d, the task is to left rotate the string by d positions. Examples: Input: s = "GeeksforGeeks", d = 2Output: "eksforGeeksGe" Explanation: After the first rotation, string s becomes "eeksforGeeksG" and after the second rotation, it becomes "eksforGeeksGe". Input: s = "q
      15+ min read

    • Sort string of characters
      Given a string of lowercase characters from 'a' - 'z'. We need to write a program to print the characters of this string in sorted order. Examples: Input : "dcab" Output : "abcd"Input : "geeksforgeeks"Output : "eeeefggkkorss" Naive Approach - O(n Log n) TimeA simple approach is to use sorting algori
      5 min read

    • Frequency of Characters in Alphabetical Order
      Given a string s, the task is to print the frequency of each of the characters of s in alphabetical order.Example: Input: s = "aabccccddd" Output: a2b1c4d3 Since it is already in alphabetical order, the frequency of the characters is returned for each character. Input: s = "geeksforgeeks" Output: e4
      9 min read

    • Swap characters in a String
      Given a String S of length N, two integers B and C, the task is to traverse characters starting from the beginning, swapping a character with the character after C places from it, i.e. swap characters at position i and (i + C)%N. Repeat this process B times, advancing one position at a time. Your ta
      14 min read

    • C Program to Find the Length of a String
      The length of a string is the number of characters in it without including the null character (‘\0’). In this article, we will learn how to find the length of a string in C. The easiest way to find the string length is by using strlen() function from the C strings library. Let's take a look at an ex
      2 min read

    • How to insert characters in a string at a certain position?
      Given a string str and an array of indices chars[] that describes the indices in the original string where the characters will be added. For this post, let the character to be inserted in star (*). Each star should be inserted before the character at the given index. Return the modified string after
      7 min read

    • Check if two strings are same or not
      Given two strings, the task is to check if these two strings are identical(same) or not. Consider case sensitivity. Examples: Input: s1 = "abc", s2 = "abc" Output: Yes Input: s1 = "", s2 = "" Output: Yes Input: s1 = "GeeksforGeeks", s2 = "Geeks" Output: No Approach - By Using (==) in C++/Python/C#,
      7 min read

    • Concatenating Two Strings in C
      Concatenating two strings means appending one string at the end of another string. In this article, we will learn how to concatenate two strings in C. The most straightforward method to concatenate two strings is by using strcat() function. Let's take a look at an example: [GFGTABS] C #include <s
      3 min read

    • Remove all occurrences of a character in a string
      Given a string and a character, remove all the occurrences of the character in the string. Examples: Input : s = "geeksforgeeks" c = 'e'Output : s = "gksforgks"Input : s = "geeksforgeeks" c = 'g'Output : s = "eeksforeeks"Input : s = "geeksforgeeks" c = 'k'Output : s = "geesforgees" Using Built-In Me
      2 min read

    Binary String

    • Check if all bits can be made same by single flip
      Given a binary string, find if it is possible to make all its digits equal (either all 0's or all 1's) by flipping exactly one bit. Input: 101Output: YeExplanation: In 101, the 0 can be flipped to make it all 1 Input: 11Output: NoExplanation: No matter whichever digit you flip, you will not get the
      5 min read

    • Number of flips to make binary string alternate | Set 1
      Given a binary string, that is it contains only 0s and 1s. We need to make this string a sequence of alternate characters by flipping some of the bits, our goal is to minimize the number of bits to be flipped. Examples : Input : str = “001” Output : 1 Minimum number of flips required = 1 We can flip
      8 min read

    • Binary representation of next number
      Given a binary string that represents binary representation of positive number n, the task is to find the binary representation of n+1. The binary input may or may not fit in an integer, so we need to return a string. Examples: Input: s = "10011"Output: "10100"Explanation: Here n = (19)10 = (10011)2
      6 min read

    • Min flips of continuous characters to make all characters same in a string
      Given a string consisting only of 1's and 0's. In one flip we can change any continuous sequence of this string. Find this minimum number of flips so the string consist of same characters only.Examples: Input : 00011110001110Output : 2We need to convert 1's sequenceso string consist of all 0's.Input
      8 min read

    • Generate all binary strings without consecutive 1's
      Given an integer n, the task is to generate all binary strings of size n without consecutive 1's. Examples: Input : n = 4Output : 0000 0001 0010 0100 0101 1000 1001 1010 Input : n = 3Output : 000 001 010 100 101 Approach: The idea is to generate all binary strings of length n without consecutive 1's
      6 min read

    • Find i'th Index character in a binary string obtained after n iterations
      Given a decimal number m, convert it into a binary string and apply n iterations. In each iteration, 0 becomes "01" and 1 becomes "10". Find the (based on indexing) index character in the string after the nth iteration. Examples: Input : m = 5, n = 2, i = 3Output : 1Input : m = 3, n = 3, i = 6Output
      6 min read

    Substring and Subsequence

    • All substrings of a given String
      Given a string s, containing lowercase alphabetical characters. The task is to print all non-empty substrings of the given string. Examples : Input : s = "abc"Output : "a", "ab", "abc", "b", "bc", "c" Input : s = "ab"Output : "a", "ab", "b" Input : s = "a"Output : "a" [Expected Approach] - Using Ite
      9 min read

    • Print all subsequences of a string
      Given a string, we have to find out all its subsequences of it. A String is said to be a subsequence of another String, if it can be obtained by deleting 0 or more character without changing its order. Examples: Input : abOutput : "", "a", "b", "ab" Input : abcOutput : "", "a", "b", "c", "ab", "ac",
      12 min read

    • Count Distinct Subsequences
      Given a string str of length n, your task is to find the count of distinct subsequences of it. Examples: Input: str = "gfg"Output: 7Explanation: The seven distinct subsequences are "", "g", "f", "gf", "fg", "gg" and "gfg" Input: str = "ggg"Output: 4Explanation: The four distinct subsequences are "",
      14 min read

    • Count distinct occurrences as a subsequence
      Given two strings pat and txt, where pat is always shorter than txt, count the distinct occurrences of pat as a subsequence in txt. Examples: Input: txt = abba, pat = abaOutput: 2Explanation: pat appears in txt as below three subsequences.[abba], [abba] Input: txt = banana, pat = banOutput: 3Explana
      15+ min read

    • Longest Common Subsequence (LCS)
      Given two strings, s1 and s2, the task is to find the length of the Longest Common Subsequence. If there is no common subsequence, return 0. A subsequence is a string generated from the original string by deleting 0 or more characters, without changing the relative order of the remaining characters.
      15+ min read

    • Shortest Superstring Problem
      Given a set of n strings arr[], find the smallest string that contains each string in the given set as substring. We may assume that no string in arr[] is substring of another string.Examples: Input: arr[] = {"geeks", "quiz", "for"}Output: geeksquizforExplanation: "geeksquizfor" contains all the thr
      15+ min read

    • Printing Shortest Common Supersequence
      Given two strings s1 and s2, find the shortest string which has both s1 and s2 as its sub-sequences. If multiple shortest super-sequence exists, print any one of them.Examples: Input: s1 = "geek", s2 = "eke"Output: geekeExplanation: String "geeke" has both string "geek" and "eke" as subsequences.Inp
      9 min read

    • Shortest Common Supersequence
      Given two strings s1 and s2, the task is to find the length of the shortest string that has both s1 and s2 as subsequences. Examples: Input: s1 = "geek", s2 = "eke"Output: 5Explanation: String "geeke" has both string "geek" and "eke" as subsequences. Input: s1 = "AGGTAB", s2 = "GXTXAYB"Output: 9Expl
      15+ min read

    • Longest Repeating Subsequence
      Given a string s, the task is to find the length of the longest repeating subsequence, such that the two subsequences don't have the same string character at the same position, i.e. any ith character in the two subsequences shouldn't have the same index in the original string. Examples: Input: s= "a
      15+ min read

    • Longest Palindromic Subsequence (LPS)
      Given a string s, find the length of the Longest Palindromic Subsequence in it. Note: The Longest Palindromic Subsequence (LPS) is the maximum-length subsequence of a given string that is also a Palindrome. Examples: Input: s = "bbabcbcab"Output: 7Explanation: Subsequence "babcbab" is the longest su
      15+ min read

    • Longest Palindromic Substring
      Given a string s, the task is to find the longest substring which is a palindrome. If there are multiple answers, then return the first appearing substring. Examples: Input: s = "forgeeksskeegfor" Output: "geeksskeeg"Explanation: There are several possible palindromic substrings like "kssk", "ss", "
      12 min read

    Palindrome

    • C Program to Check for Palindrome String
      A string is said to be palindrome if the reverse of the string is the same as the string. In this article, we will learn how to check whether the given string is palindrome or not using C program. The simplest method to check for palindrome string is to reverse the given string and store it in a tem
      4 min read

    • Check if a given string is a rotation of a palindrome
      Given a string, check if it is a rotation of a palindrome. For example your function should return true for "aab" as it is a rotation of "aba". Examples: Input: str = "aaaad" Output: 1 // "aaaad" is a rotation of a palindrome "aadaa" Input: str = "abcd" Output: 0 // "abcd" is not a rotation of any p
      15+ min read

    • Check if characters of a given string can be rearranged to form a palindrome
      Given a string, Check if the characters of the given string can be rearranged to form a palindrome. For example characters of "geeksogeeks" can be rearranged to form a palindrome "geeksoskeeg", but characters of "geeksforgeeks" cannot be rearranged to form a palindrome. Recommended PracticeAnagram P
      14 min read

    • Online algorithm for checking palindrome in a stream
      Given a stream of characters (characters are received one by one), write a function that prints 'Yes' if a character makes the complete string palindrome, else prints 'No'. Examples: Input: str[] = "abcba"Output: a Yes // "a" is palindrome b No // "ab" is not palindrome c No // "abc" is not palindro
      15+ min read

    • Print all Palindromic Partitions of a String using Bit Manipulation
      Given a string, find all possible palindromic partitions of a given string. Note that this problem is different from Palindrome Partitioning Problem, there the task was to find the partitioning with minimum cuts in input string. Here we need to print all possible partitions. Example: Input: nitinOut
      10 min read

    • Minimum Characters to Add at Front for Palindrome
      Given a string s, the task is to find the minimum number of characters to be added to the front of s to make it palindrome. A palindrome string is a sequence of characters that reads the same forward and backward. Examples: Input: s = "abc"Output: 2Explanation: We can make above string palindrome as
      12 min read

    • Make largest palindrome by changing at most K-digits
      Given a string containing all digits, we need to convert this string to a palindrome by changing at most K digits. If many solutions are possible then print lexicographically largest one.Examples: Input : str = “43435” k = 3Output : "93939" Explanation:Lexicographically largest palindrome after 3 ch
      15 min read

    • Minimum Deletions to Make a String Palindrome
      Given a string s of length n, the task is to remove or delete the minimum number of characters from the string so that the resultant string is a palindrome. Note: The order of characters should be maintained. Examples : Input : s = "aebcbda"Output : 2Explanation: Remove characters 'e' and 'd'. Resul
      15+ min read

    • Minimum insertions to form a palindrome with permutations allowed
      Given a string of lowercase letters. Find minimum characters to be inserted in the string so that it can become palindrome. We can change the positions of characters in the string. Examples: Input: geeksforgeeksOutput: 2Explanation: geeksforgeeks can be changed as: geeksroforskeeg or geeksorfroskeeg
      5 min read

geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences