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....
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.
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 ???
I need to extract a portion of text from one field and put it in another field and I am having trouble with the syntex. I am doing this with an sql select statement in asp.net.
I can select the left most characters of the field (SELECT BatchNumber, LEFT(BatchNumber, 3) AS Expr1 FROM DonorHistory) or the right most characters of the field (SELECT BatchNumber, RIGHT(BatchNumber, 3) AS Expr1 FROM DonorHistory) but I cannot select characters from the middle of the field. I expected that to be able to use a statements such as "SELECT BatchNumber, mid(BatchNumber, 3, 2) AS Expr1 FROM DonorHistory" but this statement gives me an error. I also tried using middle in place of mid but that did not work either.
What am I doing wrong?
I have a string which is XML. I have to remove all the XML namespaces from this string. That is creating lots of problems while updating XML element values.
Here is my XML. Now out of this XML, I want to remove all the xmlIns, xmlIns:xsi and xmlIns:xsd, I mean all the XML Namespaces.
Can someone provide C# code to do this please?
<?xml version="1.0" encoding="utf-16"?>
<ServerInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GenerationDate xmlns="http://www.MYSITE.com/WebServices">10/5/2010 12:53:13 PM</GenerationDate>
<ContactAddress>200 Cottontail Ln
Somerset, NJ 08873</ContactAddress>
<Notes>9/2/09 SO 41233
9/8/09 SO 41369
9/25/09 TL loaner
7/23/10 FR/Convert to perm</Notes>
How to remove tab from the string?
I have date in my results where squares appear - how to i replace non-letter characters with empty string...They are squares in windows they are like ALT + 0 + 1
I have tried trim , rtrim - no luck
I've built a workflow item to set a variable to a combination of multiple fields through String Builder.
It seems to be adding a characters like ; and # (see below) when the results are fed into a field.
Can anyone advice of the best way to clean an input string from characters that will cause SQL Update error? For instance:
Dim sText as string = 'this is line to a break <br> before the end.'Dim SQLString as string = "update sometable set somefield='" & sText & "'"
Executing SQLString will fail because of the <br> it contains. Any idea how to filter out all possible characters that will cause the update query to fail?
how can i remove "�" from a string c#
thanks in advance
hi,all, I have a string of tags like:
<A href How to Encrypt Query String Parameters in ASP.NET Encrypt Query String Parameters in ASP.NET.u can send secure data one page another page u can also use query string to encrypt