Result = Subst$ ( Pattern , ReplaceString [ , ReplaceString ] ) Result = Subst ( Pattern , ReplaceString [ , ReplaceString ] )
Replaces substrings &1, &2, etc. in a pattern with the first, second, and subsequent ReplaceString argument respectively, and returns the result.
If Pattern is null, then a null string is returned.
For C developers, this is not unlike a simplified sprintf.
PRINT Subst("Gambas is a cool &1", "BASIC")
Gambas is a cool BASIC
![]() |
This function is very useful when you must concatenate strings that must be translated.
Do not use the & operator, as the order of concatenation might change with the language.
For example:
will be translated in french this way:
|