multiply a string variable?

Results 1 to 2 of 2

Thread: multiply a string variable?

  1. #1
    particklocke Guest

    Default multiply a string variable?

    how do i write to repeat a char variable multipied by an int?<BR>ex:<BR><BR>dim space, nit<BR><BR>nit = 2<BR>space = "&nbsp;"&nbsp;"&nbsp;"<BR><BR>response.write space x 2<BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default See VBScript manual

    Look at the list of functions available in VBS.<BR><BR>If all you want is spaces, just use the Space(n) function, which indeed generates n spaces.<BR><BR>If you want some other character repeated, use the String(n,theChar) function, which generates n occurrences of theChar.<BR><BR>If you need to repeat a *string* of characters, such as "abcabcabc...", then one easy way to do it would be to do<BR><BR>Replace( Space(n), " ", "abc" )<BR><BR>See it? You generate n spaces and then change each space to the needed string.<BR><BR><BR><BR>

Posting Permissions

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