Posted By

jlvallelonga on 02/10/09


delete trim csv last comma

Versions (?)

Who likes this?

3 people have marked this snippet as a favorite


Delete Last Comma

 / Published in: ASP

This function takes a string and deletes the last comma in it. It is meant for strings with a trailing comma such as "13, 24, 15, "

  1. function deleteLastComma(valStr)
  2. lastCommaPos = instrrev(valStr, ",")
  3. valStr = mid(valStr, 1, lastCommaPos - 1)
  4. deleteLastComma = valStr
  5. end function

Report this snippet  


RSS Icon Subscribe to comments
Posted By: braunsHizzzle on April 8, 2009

I've posted the PHP equivalent to this of mine @

You need to login to post a comment.