Answered by:
How to remove SIngle quote(') from strings

Question
-
I am developing windows applications
I havea strings and it contains single quote('). How do I remove quote from string
How Do i remove quote from strings?
Help me
thank you
MaxsMonday, February 2, 2009 9:09 PM
Answers
-
Try the replace function
Dim Mystring As String = "abcdef'ghijklmnopqrstuvwxyz" Mystring = Mystring.Replace("'", "") MessageBox.Show(Mystring)
Coding for fun- Proposed as answer by SJWhiteley Tuesday, February 3, 2009 3:01 PM
- Marked as answer by Yichun Feng Wednesday, February 4, 2009 7:13 AM
Monday, February 2, 2009 9:27 PM
All replies
-
Try the replace function
Dim Mystring As String = "abcdef'ghijklmnopqrstuvwxyz" Mystring = Mystring.Replace("'", "") MessageBox.Show(Mystring)
Coding for fun- Proposed as answer by SJWhiteley Tuesday, February 3, 2009 3:01 PM
- Marked as answer by Yichun Feng Wednesday, February 4, 2009 7:13 AM
Monday, February 2, 2009 9:27 PM -
try this
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim firststring As String = TextBox1.Text Dim secondstring As String = "'" Dim position As Integer position = InStr(firststring, secondstring) firststring = firststring.Remove(position - 1, 1) TextBox2.Text = firststring End Sub - Edited by jwavila Monday, February 2, 2009 9:56 PM typo
Monday, February 2, 2009 9:31 PM -
thank you sir
maxsMonday, February 2, 2009 9:37 PM -
bdbodger, I edited my code. Noticed it said firststringfirststring = ... This has happened a couple of times - when I paste code it adds the second variable name. Have you seen this before or know why? Guess I just need to review it first.
jwavilaMonday, February 2, 2009 9:59 PM -
Might just be what you highlighted when you copied I can't say I have noticed . Did you mean in this forums editor box I think I did see that once .
Coding for funMonday, February 2, 2009 11:57 PM -
Yeah it was in this forum's editor box. Thanks for your post about .replace - I went the long way around - didn't think about replacing a string with an empty string (duh!). I wanted to say I really appreciate your posts on this forum, regardless of what smeone else might think. That comment was inappropriate and uncalled for, and you handled it in a very professional way. You help people out, and that is the whole point of this forum, regardless of how much experience they have. Being a noob myself, it's always nice to see different ways of doing things. Thank you for your time and effort.
jwavilaTuesday, February 3, 2009 12:59 AM -
Thank you for you comments .
Coding for funTuesday, February 3, 2009 1:02 AM