Answers for "remove char in string"

8

delete certain characters from a string python

for char in line:
    if char in " ?.!/;:":
        line.replace(char,'')
Posted by: Guest on April-08-2020
5

java string remove character

String str = "abcdDCBA123";
String strNew = str.replace("a", ""); // strNew is 'bcdDCBA123'
Posted by: Guest on July-15-2020
1

how to remove letters from string

public extractLetters(String str){
	String result="";
	for(int i= 0; i< str.length; i++){
	    if(Character.isLetter(str.charAt(i))){
	    result+=str.charAt(i);
	  	}
	}
Posted by: Guest on January-14-2021
0

remove char from string

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
Posted by: Guest on June-05-2021
0

remove charachter from string

StringBuilder sb = new StringBuilder(inputString);
Posted by: Guest on February-02-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language