Counting Characters ?

Results 1 to 4 of 4

Thread: Counting Characters ?

  1. #1
    Join Date
    Dec 1969

    Default Counting Characters ?

    I want to count the characters in a variable, for example<BR>&#060;%=rsmenucat("catname")%&#062; and then use this &#039;number of characters&#039; to set the width of a layer ?<BR>Can you do this ?

  2. #2
    Rain Man Guest

    Default Counting Cards

    I&#039;m counting cards.<BR>Counting cards.<BR>Counting cards.<BR>Yeah, counting cards.<BR>I&#039;m counting cards.

  3. #3
    Join Date
    Dec 1969

    Default RE: Counting Characters ?

    Try using Len(variableName)<BR><BR>For example:<BR><BR>&#060;%<BR>var1 = "Cat"<BR>Response.Write "var1 contains " & Len(var1) & " characters."<BR>%&#062;<BR><BR>Output: var1 contains 3 characters<BR><BR>This should apply equally to a DB field. I hope this helped you out. Oh yeah, and if you have a sentence, like "Cat and Dog" and wish to count those characters, but without the spaces, you can use the VB Replace function to replace the " " space with a "" none. You then apply the Len() functions. <BR><BR>Vadim C.

  4. #4
    Join Date
    Dec 1969

    Default yes, i can

    iNumberOfChars = Len(Trim(rsmenucat("catname")))

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts