TrimCHR Function:
Trim leading and trailing comma or other character or string from a string.
Description:
TrimCHR Function trim leading and trailing comma or other character or string from a string.
Syntax:
TrimCHR(string, trimstring)
Example:
<%
Str = ",,alfa,beta,charly," Response.Write TrimCHR(Str, ",") '--- Result: alfa,beta,charly
%>
ASP Source Code:
<%
Function TrimCHR(Str, trimStr) While Trim(left(Str, 1)) = trimStr Str = Trim(right(Str, Len(Str) - 1)) Wend While Trim(right(str,1)) = trimStr Str = Trim(Left(Str, Len(Str) - 1)) Wend TrimCHR = Str End Function
%>
|