SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
Pastimes : Silicon Investor, under the hood -- Ignore unavailable to you. Want to Upgrade?


To: SI Dave who wrote (44)1/11/2005 10:12:53 PM
From: Green Receipt  Respond to of 81
 
The reason why I asked is you could use it to your advantage.

Something like this:

Dim item as String
Dim strSql As New stringbuilder()
strSql.append("DoThis '")
For Each item In Request.form("str")
if item == "," then
strsql.append("','")
else
strsql.append(item)
endif
Next


Then use the Left function to truncate off the trailing ",'"

something like

strsql = strsql.Left(strsql.Length() -2)

Basically using the knowledge that the thing is handing you comma delmited stuff you can use that comma to your advantage by using it as the delimiter.
Whenever we find a comma we stick in its place a quote comma quote ','

Any other time we just append the character we have.

I don't have vb.net here but the end result should be pretty dern close to what you wanted.

but then the way this one works, almost says to me there really an even easier way.... in memory its aaa,bbb,ccc,ddd,eee

in python i could easily turn that into a list of strings.