String Function

Tips >>ASP Functions

WANTS TO MAKE SOFTWARE WITHOUT KNOWLEDGE OF ASP? CLICK HERE


The String function returns a string that contains a repeating character of a specified length. The String() function creates a string of optional length filled with the specified character. The length of the returned string.

There are Two Mandatory Argument :-

  • Number :-The Number argument must an integer and defines the number of times to repeat the character.

  • Character :-The Character argument is a single character. It must be inside a pair of double quotes. The character code specifying the character or string expression whose first character is used to build the return string. If character contains Null, Null is returned.

The Syntax of the String function is :-

String(number,character)

Example#1 :-

Code :-
document.write(String(10,"#"))
Output :-
##########

Example#2 :-

Code :-
document.write(String(4,"*"))
Output :-
****

Example#3 :-

Code :-
document.write(String(4,42))
Output :-
****

Example#4 :-

Code :-
document.write(String(4,"XYZ"))
Output :-
XXXX

Example#5 :-

Code :-
document.write(String(3, "T"))
Output :-
"TTT"

Example#6 :-

Code :-
document.write(String(5, "?"))
Output :-
"?????"

Example#7 :-
It explains the Character Argument

Code :-
document.write(String(33, "!"))
Output :-
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

 
E-mail : sales@virtualsplat.com
Phone : +91-9892413501

Whatsapp Icon +91-9967648641

Whatsapp Icon +91-9967648641