eramgarden Posted January 31, 2006 Posted January 31, 2006 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?? Quote
Administrators PlausiblyDamp Posted January 31, 2006 Administrators Posted January 31, 2006 Could you post the string literal that tempCostIDs contains when you are executing the .IndexOf? If it really contains the correct string then it should be returning a value > 0 Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.