Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replacing characters in a string?

Status
Not open for further replies.

Troy28M

Programmer
Jan 24, 2005
24
US
I know this is probably a noob question but I need help.

I am trying to push data to a pdf file through the command line, which works but since the restricted characters (ampersand (&) and spaces) I want to manipulate once passed to the form. Right now I have spaces as Underscores and ampersands as plus signs. My code is something like this

case 'G':
var firstname = this.getField("firstname");
firstname.value=fields.substring(2,fields .length);
break;

I would like to replace the + and _ characters within this string before it prints on the pdf form.

TIA
 
Because you can't pass spaces and/or ampersands through the command line, I had to change them to underscores and plus signs. I would like for example to change "Web_&_Page" to "Web Page" on the pdf form.

Obviously I would have to push "Web_&_Page" through the command line but the PDF file should show the correct
"Web Page".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top