Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I'm concating a string together. Then using "indexof" to see if a particular string is in that concated string. I used the link below:

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=169&lngWId=10

 

---This is what i have:

dim tempCostIDs as string 
tempCostIDs = string.Empty 
... 
tempCostIDs = tempCostIDs & "," & cost.CostTypeID & "," 
... 
Dim Freight As String 
       Freight = ",1," 
       Dim r As Integer 
     [b]  r = tempCostIDs.IndexOf(Freight) [/b]
       If r > 0 Then 
          'do whatever 
       End If 

-- I put a debug step. I see "tempCostIDs" has having ",1," in it but that r>0 fails . Howcome it cant find the string in it??

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...