Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have situation where i have statements as follows:

COM="this is text i want to extract"

 

I want to remove COM=" and " at right.

Can't do it with split function because " cannot be used as split delimiter.

 

Any ideas?

 

thanks

  • *Experts*
Posted

You can search for a quote using a double quote:

""

Double quote stands for a single quote when used in string.

So you can use it in split:

Dim str As String = "COM:""Some text"""
DIm strs() As String = str.Split("""")

  • *Experts*
Posted
You can also use the IndexOf method of the string object, and look for quotes. IndexOf returns the number of characters at which the string you are looking for starts. So you could have two of IndexOf calls that will look for a quote and then use SubString method to get the string from between the quotes.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...