If I have a file like this:
I have a file that has space
How can I do a replace of any amount of space (1 to 20)? I'd like to take that line and replace it with something like : so I can then split into an array.
Replace any amount of space
Started by Frantic, Aug 09 2006 05:24 AM
4 replies to this topic
#1
Posted 09 August 2006 - 05:24 AM
|
|
|
#2
Posted 09 August 2006 - 07:29 PM
Frantic said:
If I have a file like this:
I have a file that has space
How can I do a replace of any amount of space (1 to 20)? I'd like to take that line and replace it with something like : so I can then split into an array.
I have a file that has space
How can I do a replace of any amount of space (1 to 20)? I'd like to take that line and replace it with something like : so I can then split into an array.
You'll want to do a RegEx lreplace. The pattern would be " +" (1 or more space) and you'd replace with the single character you want (either a single space or colon - whatever you prefer).
#3
Posted 10 August 2006 - 02:15 PM
That is a bit odd, your sentance only has one space between each word.
#4
Posted 14 August 2006 - 11:52 AM
Usually sentences do only have one space between each word...
#5
Posted 16 August 2006 - 06:23 PM
HTML compresses spaces. Do a View Source to see his actual comment with spaces intact.


Sign In
Create Account


Back to top









