Delete Last Comma

/ Published in: ASP
Save to your folder(s)

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, "

Copy this code and paste it in your HTML
  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

You need to login to post a comment.