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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Carriage Return in String

Status
Not open for further replies.

RJL1

Technical User
Oct 3, 2002
228
US
Hello,

We have the following string which is generated from our warehouse management system into an XML file. We grab the error tag from the XML file and use it to send an email with the error. The error is a single string that looks like this

Code:
Invalid receipt (81989373):Invalid receipt detail (40):Invalid item.:Item "12345678" with company "Acme" does not exist.

We like to present it like this

Code:
Invalid receipt (81989373):
Invalid receipt detail (40):
Invalid item.:Item "E0919806" with company "Energizer" does not exist.

Basically we like to add a carriage return after every ":"

Is this even possible

Thanks in advance
RJL
 
You will likely have to parse that with some sort of scripting language. javascript or your server-side language of choice.
 
Code:
strError = "Invalid receipt (81989373):Invalid receipt detail (40):Invalid item.:Item \"12345678\" with company \"Acme\" does not exist.";
strError = strError.replace(/:/g,":\n");
alert(strError);


--------

GOOGLE is a great resource to find answers to questions like "how do i..."


--------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top