|
| Author |
Message |
Pyrox
Joined: 10 Feb 2003
Posts: 158
Location: Blorp
|
Posted: 3/19/2003, 6:33 pm Post subject: Get a newline character (\n) out of a string with Javascript |
|
|
How do i get a newline character out of a string with javascript? If i pull the data from a text box and filter out all the newline characters and then put it back. Any thoughts???
ASAP PLEASE!
Pyrox _________________ Developercube Mod
Happiness is a belt-fed weapon
Consciousness: That annoying time between naps.
Out of my mind. Back in five minutes
Want a free ipod? |
|
| Back to top |
|
 |
axman
Joined: 07 Feb 2003
Posts: 160
Location: Wisconsin
|
Posted: 3/24/2003, 2:28 pm Post subject: |
|
|
See if there is an equivelant of the perl command chomp. which removes the trailing line feed. _________________ Aaron Axelsen
DeveloperCube Forums Director
aaron@developercube.com |
|
| Back to top |
|
 |
Pyrox
Joined: 10 Feb 2003
Posts: 158
Location: Blorp
|
Posted: 3/24/2003, 5:09 pm Post subject: |
|
|
Ok, for all you guys out there... here is what i came up with to do the job. It's not javascript thought, it's now VBscript. OH well...
strComent=replace(IdentifierInformationTwo.value, vbcrlf, " ") _________________ Developercube Mod
Happiness is a belt-fed weapon
Consciousness: That annoying time between naps.
Out of my mind. Back in five minutes
Want a free ipod? |
|
| Back to top |
|
 |
komputor
Joined: 10 Apr 2003
Posts: 17
Location: abita springs, la
|
Posted: 1/29/2004, 9:05 pm Post subject: |
|
|
here's one i cooked up long ago..
function trim(str) {
return( ("" + str).replace(/^\s+/,'').replace(/\s+$/,'') );
} |
|
| Back to top |
|
 |
Paul
Joined: 18 Jan 2004
Posts: 137
Location: Worthing, UK
|
|
| Back to top |
|
 |
Pyrox
Joined: 10 Feb 2003
Posts: 158
Location: Blorp
|
Posted: 1/30/2004, 10:27 pm Post subject: |
|
|
Wow... yea, that was a while back.... dont' even remember the point of posting this... hmmm....
Thanks anyways!
Pyrox _________________ Developercube Mod
Happiness is a belt-fed weapon
Consciousness: That annoying time between naps.
Out of my mind. Back in five minutes
Want a free ipod? |
|
| Back to top |
|
 |
|