{{fbdoc item="title" value="STRING (Function)"}}----
Creates and fills a string of a certain length with a certain character

{{fbdoc item="syntax"}}##
	[[KeyPgDeclare|declare]] [[KeyPgFunction|function]] **String** ( [[KeyPgByval|byval]] //count// [[KeyPgAs|as]] [[KeyPgInteger|integer]], [[KeyPgByval|byval]] //ch_code// [[KeyPgAs|as]] [[KeyPgLong|long]] ) [[KeyPgAs|as]] [[KeyPgString|string]]
	[[KeyPgDeclare|declare]] [[KeyPgFunction|function]] **String** ( [[KeyPgByval|byval]] //count// [[KeyPgAs|as]] [[KeyPgInteger|integer]], [[KeyPgByref|byref]] //ch// [[KeyPgAs|as]] [[KeyPgConstQualifier|const]] [[KeyPgString|string]] ) [[KeyPgAs|as]] [[KeyPgString|string]]
##
{{fbdoc item="usage"}}##
	//result// = **String**[$]( //count//, //ch_code// )
		##//or//##
	//result// = **String**[$]( //count//, //ch// )
##
{{fbdoc item="param"}}
	##//count//##
		An integer specifying the length of the string to be created.
	##//ch_code//##
		A long specifying the [[CptAscii|ASCII]] character code to be used to fill the string.
	##//ch//##
		A string whose first character is to be used to fill the string.

{{fbdoc item="ret"}}
	The created string. An empty string will be returned if either ##//ch//## is an empty string, or ##//count//## <= 0.

{{fbdoc item="desc"}}
	The ##**String**## function returns a string with a length of ##//count//##, filled with a given ##//ch_code//## or ##//ch//##.

{{fbdoc item="ex"}}
{{fbdoc item="filename" value="examples/manual/strings/string.bas"}}%%(freebasic)
PRINT STRING( 4, 69 )         '' prints "EEEE"
PRINT STRING( 5, "Indeed" )   '' prints "IIIII"
end 0
%%

{{fbdoc item="lang"}}
	- The string type suffix "$" is obligatory in the //[[CompilerOptlang|-lang qb]]// dialect.
	- The string type suffix "$" is optional in the //[[CompilerOptlang|-lang fblite]]// dialect.
	- The string type suffix "$" is forbidden in the //[[CompilerOptlang|-lang fb]]// dialect.

{{fbdoc item="diff"}}
	- None 

{{fbdoc item="see"}}
	- ##[[KeyPgString|String]] (data type)##
	- ##[[KeyPgSpace|Space]]##

{{fbdoc item="back" value="CatPgString|String Functions"}}
   
