Skip to content

String.FormatUsing

boxgaming edited this page Jul 25, 2026 · 2 revisions

Formats a string using the same format pattern as the PRINT USING keyword.

Syntax

result$ = String.FormatUsing ( s$, format$ )

Parameters

  • The s$ parameter contains the source string.
  • The format$ indicates the formatting pattern to use.

Example

Import String From "lib/lang/string.bas"

Print String.FormatUsing("$###,###.##", 5621.2341)
Print String.FormatUsing("**$###.##", 14.5)
Print String.FormatUsing("First Name: [\    \]", "Doug")
Print String.FormatUsing("Initials - First: [!], Last: [!]", "Doug", "Smith")

Output

  $5,621.23
***$14.50
First Name: [Doug  ]
Initials - First: [D], Last: [S]

See Also

PRINT USING

Clone this wiki locally