String: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
Brendon (talk | contribs)
Created page with "STRING(''number, ''character'') '''Description''' STRING returns a string created by concatenating a given number of a specified character. The required argument, ''number''..."
 
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
STRING(''number, ''character'')
String(''number, ''character'')


'''Description'''
== Description ==


STRING returns a string created by concatenating a given number of a specified character. The required argument, ''number'', is any valid numeric expression. The required argument, ''character'', is a character or string expression whose first character is repeated in the returned string.
String returns a string created by concatenating a given number of a specified character. The required argument, ''number'', is any valid numeric expression. The required argument, ''character'', is a character or string expression whose first character is repeated in the returned string.


'''Example'''
HTML formatting rules apply to strings being output in fields which support HTML. In particular, multiple spaces are rendered as a single space. So, while you may insert several spaces in your string, using 'Print string' will display them as they were a single space. Use the string '&nsbp;' to force a space to appear.
 
== Example ==


<pre>
<pre>
REM STRING Example
Rem String Example
'STRING createsastringrepeatingacharacter
'String creates a string repeating a character
DIM Message
Dim Message
Message = STRING(10, "Hello World!")
Message = String(10, "Hello World!")
PRINT Message
Print Message
Message = STRING(10, CHR(ASC("i")))
Message = String(10, Chr(Asc("i")))
PRINT Message
Print Message
</pre>
</pre>


'''Output'''
== Output ==


<pre>
<pre>
Line 24: Line 26:
</pre>
</pre>


'''Related Items'''
== Related Items ==
 
[[space|Space]]
 
[[Category:Language Reference]]


[[space|SPACE]]
[[Category:Strings]]

Latest revision as of 07:49, 18 October 2013

String(number, character)

Description

String returns a string created by concatenating a given number of a specified character. The required argument, number, is any valid numeric expression. The required argument, character, is a character or string expression whose first character is repeated in the returned string.

HTML formatting rules apply to strings being output in fields which support HTML. In particular, multiple spaces are rendered as a single space. So, while you may insert several spaces in your string, using 'Print string' will display them as they were a single space. Use the string '&nsbp;' to force a space to appear.

Example

Rem String Example
'String creates a string repeating a character
Dim Message
Message = String(10, "Hello World!")
Print Message
Message = String(10, Chr(Asc("i")))
Print Message

Output

HHHHHHHHHH
iiiiiiiiii

Related Items

Space