"strip" refers to the process of removing (stripping) certain characters from a string. A common example is removing trailing whitespace characters.
Questions tagged [strip]
1330 questions
-1
votes
1 answer
Calling String in same class
I have this jButton that transfers the text from one text area to another but now I need to make it strip the sentence but I don't know how to call on the strip string. Thanks in advance!
Here's the code:
package encryptor;
import…

BradleyN
- 1
- 1
- 1
-1
votes
2 answers
Remove Certain Alphanumeric Characters from a String in Ruby
I have to validate a string based on first alpha-numeric character of the string. Certain characters can be part of the string but if they are at beginning then they have to ignored.
For example:
--- BATest- 1 --
should be:
BATest-1
How do I…

user3075906
- 725
- 1
- 8
- 19
-1
votes
2 answers
PHP Strip
My php knowledge is not enough. Also so sorry for my bad English.
I want to clear all html
-1
votes
2 answers
Need to use a batch Windows OS script to strip out excess text
I am trying to strip out unwanted text in a .txt file and its not the entire line.
Here is an example of text:
C:\Users\cph\AppData\Local\Temp\results_2017-01202016.txt: Geekbench Score 3646 …

Danny Brito
- 21
- 1
- 7
-1
votes
3 answers
I am finding that .rstrip('.csv') is stripping a 'c' I don't want it to strip - how to prevent this?
If I have a string (filename) that is something on the order of xyc.csv, and this name is stored as stringA, I found that:
stringB = stringA.rstrip('.csv')
Ends up causing stringB to have a value of xy, when it should have a value of xyc. Or at…

traggatmot
- 1,423
- 5
- 26
- 51
-1
votes
2 answers
Deletion of multiple characters inside of a string
i want the string 'abc'
abc="['one']"\n['two']"
to output
one
two
as far as i know:
.strip() only replaces characters at the beginning and at the ending of the string
.translate() only takes one variable
.replace() only works with 1 character.

Michael
- 65
- 4
-1
votes
4 answers
Remove a part of a tag in php
I want to remove tags from php to show this results:
Before:
1:
2:


Fiorelo Odobashi
- 121
- 1
- 1
- 11
-1
votes
1 answer
Make href hypertext links in JSON strings work in iOS app
I'm using JSON in my app to call elements from a database.
One of these elements is a text block with href links.
The JSON looks like :
"textBlock":"Link<\/a>
In my app I call label with…

David
- 213
- 3
- 10
-1
votes
2 answers
Question Mark ("?") Getting Appended to String
So I am writing a program and am using an existing library written by someone else. Their library is making a call to TheMovieDatabase.com and retrieving information about a movie, including the Youtube trailer name like 'sErD7Y00R_8'.
When I am…

Kairan
- 5,342
- 27
- 65
- 104
-1
votes
2 answers
What is happening inside this regex alteration expression
The following regular expresion works but can anyone explain how?
Any comment is appreciated! Thanks! Quinoa
What is the regex "|" doing to strip the tags "" and "" from to get "Keep THIS" into memory $1?
Here is the…

quinoa
- 13
- 2
-1
votes
1 answer
Reading and Striping a text file
import re
f= ('HelloHowAreYou')
f = re.sub(r"([a-z\d])([A-Z])", r'\1 \2', f)
# Makes the string space separated. You can use split to convert it to list
f = f.split()
print (f)
this works fine to separate all the string of text by capital letters,…

P_Lee
- 65
- 7
-1
votes
4 answers
Read values from URL parameter where slashes are represented by %2F in PHP
The datepicker I'm using passes the date to a php script on form submit.
The URL parameter is as follows - datepicker1=12%2F09%2F2014
I can store 12%2F09%2F2014 in a variable.
$datepicker1 = $_GET['datepicker1'];
I also have 3 other variables…

Cody Raspien
- 1,753
- 5
- 26
- 51
-1
votes
1 answer
preg_replace to clean my image filenames
I'll get right into it....
I have a problem with my ajax livesearch, using xml for a kind of inventory image search function, the code sees the image filenames imported into an xml file for use in the livesearch, however, image filenames with some…

WebEducate
- 79
- 2
- 17
-1
votes
1 answer
Stripping out \\n plus whitespace using .strip() and regex is not working
I've been attempting to strip out the \n plus the whitespace before and after the words from a string, but it is not working for some reason.
This is what I tried:
.strip(my_string)
and
re.sub('\n', '', my string)
I have tried using .strip and re…

maudulus
- 10,627
- 10
- 78
- 117
-1
votes
1 answer
strip() working in one place and not in another
I'm trying to parse a text file, and am using almost the same line of code in two places. Both are essentially the following:
for line in scratch:
line = line.lstrip(u' ¶.1234567890')
The version where this works is reading from a .txt file,…

Ben Forde
- 81
- 1
- 1
- 4