Posted By

jlvallelonga on 02/10/09


Tagged

delete trim csv last comma


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

nelda751
asifrizvigmailcom
higrade


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  

Comments

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

I've posted the PHP equivalent to this of mine @ http://snipplr.com/view/13885/delete-last-comma-in-a-string/

You need to login to post a comment.