Say I have a string in a text box like
I wish to count the number of pipes or '|'.
How can I do this with js ???
View Complete Post
I'm trying to strip illegal characters out of an XML string before I send it off to a public web service. The xml will look something like this:
<field name="notes">This is a note. Any character could appear here</field>
I need to pull out any ampercand (&) charachters in the any of the fields, as well as any < or > characters, which would make the XML unreadable.
I've tried it like this:
Private Shared Function cleanQuery(ByVal queryNode As String) As String
Dim root As XElement = XElement.Parse(queryNode)
For Each x As XElement In root.Elements
x.Value = x.Value.Replace("&", "&").Replace("<", "<").Replace(">", ">")
That doesn't work so well. I get the error stating:
There are multiple root elements. Line 1, position 15.
I tried wrapping the XML in a single root element, like this:
Private Shared Function cleanQuery2(ByVal q
I am working on a site where I use the Split function on a string.
To make sure I used a separator character that I do not use anywhere in the data I selected the character 'ÃÂ£'.
This worked fine in Firefox and Safari, but in IE8 I get an 'Index out of range' error, so apparently the 'ÃÂ£' character is not handled correctly.
I changed the separator to ';', and then it works fine.
i have a string like this sravani/, asdfff/, lsdsf/i want to remove last character '/' in the above string...which function can i use?pls help me....
HiIm receiving a strange error Error Message: Conversion from string "15/08/2010 22:21:35" to type 'Date' is not valid.I know this is generally down to cultural date formats etc, however the reason this is strange is it just randomly occured twice in the last week, the website has been running since october and nothing has changed,The error constantly occured until the IIS was reset and recompilled the site, its been running fine since, however im just trying to figure out what could cause such an error to occur.I've narrowed it down to a line of code which is:bktime = DReader.Item("Bktime").ToStringbktime = Year(CDate(bktime)) & "-" & fmt(Month(CDate(bktime)), 2) & "-" & fmt(Day(CDate(bktime)), 2)
Has anyone else encountered this randomly occuring and is there anything i can put in place to prevent this in future?CheersMike