Answered by : filippo-sergenti
// removing char at index 3
var str = "Hello World";
str = str.slice(0, 3) + str.slice(4);
console.log(str) // Helo World
Source : | Last Update : Mon, 24 Aug 20
Answered by : mysterious-mole-y1g4oq76tyse
s = 'ab12abc34ba'
print(s.replace('ab', ''))
Source : https://www.journaldev.com/23674/python-remove-character-from-string | Last Update : Sat, 19 Sep 20
Answered by : exuberant-eel-2vjub8sho7i7
"Str*ing With Chars I! don't want".replace('!','').replace('*','')
Source : | Last Update : Wed, 20 May 20
Answered by : adorable-antelope-ed367lh1s6wp
# subString(int start, int end);
String a = "Hello!";
b = a.subString(0,a.length()-1) #Remove the last String
# b should be "Hello" then
Source : | Last Update : Wed, 13 May 20
Answered by : obedient-ocelot-5tkogtygmlyl
public extractLetters(String str){ String result=""; for(int i= 0; i< str.length; i++){ if(Character.isLetter(str.charAt(i))){ result+=str.charAt(i); } }
Source : | Last Update : Thu, 21 Jan 21
Answered by : y-hari-priya
public class RemoveCharacter
{ public static void main(String[] args) { String MyString = "Hello World"; System.out.println("The string before removing character: " + MyString); MyString = MyString.replace("e", ""); System.out.println("The string after removing character: " + MyString); }
}
Source : https://www.delftstack.com/howto/java/java-remove-character-from-string/ | Last Update : Wed, 06 Jul 22
Answered by : code-grepper
{"tags":[{"tag":"p","content":"You have reached your max daily Grepper answers. <a href=\"https://www.grepper.com/subscriptions.php\" target=\"_blank\" rel=\"nofollow\">Upgrade to professional </a>to view more Grepper answer today."},{"tag":"p","content":"<a href=\"https://www.grepper.com/api/view_product.php?hl=1&pid=42\" target=\"_blank\" rel=\"nofollow\">Upgrade To Grepper Professional</a>"}]}
Source : | Last Update : Mon, 27 Mar 23
Answered by : hassan-ammar
def replace_(input_:str,latter:int): name_ = "" checkList=[] for num in range(latter): checkList.append(num) for i in range(0, len(input_)): if i not in checkList: name_ = name_ + input_[i] return name_
name_=replace_("give hello",5)
print(name_) #will print hello
Source : https://www.askpython.com/python/string/remove-character-from-string-python | Last Update : Sat, 12 Jun 21
Answered by : charming-cardinal-6orprb62n8pc
/* C Program to Remove All Occurrences of a Character in a String */
#include <stdio.h>
#include <string.h>
int main()
{ char str[100], ch; int i, len, j; printf("\n Please Enter any String : "); gets(str); printf("\n Please Enter the Character that you want to Remove : "); scanf("%c", &ch); len = strlen(str); for(i = 0; i < len; i++) { if(str[i] == ch) { for(j = i; j < len; j++) { str[j] = str[j + 1]; } len--; i--; } } printf("\n The Final String after Removing All Occurrences of '%c' = %s ", ch, str); return 0;
}
Source : https://www.tutorialgateway.org/c-program-to-remove-all-occurrences-of-a-character-in-a-string/ | Last Update : Fri, 04 Mar 22
Answered by : inexpensive-impala-uf0v3jcl13n9
StringBuilder sb = new StringBuilder(inputString);
Source : https://stackoverflow.com/questions/13386107/how-to-remove-single-character-from-a-string | Last Update : Tue, 09 Feb 21