Associate
- Joined
- 27 Jan 2005
- Posts
- 1,373
- Location
- S. Yorks
Hi,
I need to check a string for special chars, typically ' " & % this is to be used in an odata query so far I have:
But what's an accepted way to check for all of the special chars and replace?
regards,
Matt
I need to check a string for special chars, typically ' " & % this is to be used in an odata query so far I have:
Code:
if (ProjName.indexOf("&") > 0)
{
oDataEndpointUrl += "orb_objectrelationshipSet?$select=orb_accountid,orb_name,orb_objectrelationshipId&$filter=orb_name eq '" + ProjName.replace(/\x26/,"%26")+ "' ";
}
else
{
oDataEndpointUrl += "orb_objectrelationshipSet?$select=orb_accountid,orb_name,orb_objectrelationshipId&$filter=orb_name eq '" + ProjName + "' ";
}
But what's an accepted way to check for all of the special chars and replace?
regards,
Matt