Given the string, we have to remove the ith indexed character from the string.
In any string, indexing always start from 0. Suppose we have a string geeks then its indexing will be as –
g e e k s 0 1 2 3 4
Input : Geek i = 1 Output : Gek Input : Peter i = 4 Output : Pete
Approach 1 : From the given string, i-th indexed element has to be removed. So, Split the string into two halves, before indexed character and after indexed character. Return the merged string.
Below is the implementation of above approach :
Approach 2 : The idea is to use string replace in Python
- Python - Replace to K at ith Index in String
- Python - Extract ith column values from jth column values
- Python - Extract ith Key's Value of K's Maximum value dictionary
- Python - Extract ith element of K key's value
- Python - Sort Dictionary List by Key's ith Index value
- Python - Swap ith and jth key's value in dictionary
- Python | Removing newline character from string
- Python program to read character by character from a file
- Python | Insert character after every character pair
- Python | Removing unwanted characters from string
- Python | Removing Initial word from string
- Python program to find occurrence to each character in given string
- Python Regex | Program to accept string ending with alphanumeric character
- Python program to capitalize the first and last character of each word in a string
- Python program to Extract string till first Non-Alphanumeric character
- Removing stop words with NLTK in Python
- Python | Print list after removing element at given index
- Python | Removing duplicate dicts in list
- Python | Removing dictionary from list of dictionaries
- Python | Removing strings from tuple
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : kunchamaparna509