strings
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
strings [2018/01/21 15:01] – created wolfgangriedmann | strings [2018/10/06 05:09] (current) – wolfgangriedmann | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Strings and their prefixes ====== | ====== Strings and their prefixes ====== | ||
- | A string in X# is delimited by the double | + | A string in X# is delimited by the double |
- | < | + | < |
- | This is valid for the VO, Vulcan and Code dialects. In the VO dialect a string can also be delimited by the single | + | This is valid for the VO, Vulcan and Code dialects. In the VO dialect a string can also be delimited by the single |
- | + | < | |
- | < | + | |
This is to make X# compatible to VO code. | This is to make X# compatible to VO code. | ||
- | If you need to use special characters or double | + | If you need to use special characters or double |
- | + | < | |
- | < | + | |
and of course you can also embed other control characters in your string: | and of course you can also embed other control characters in your string: | ||
- | + | < | |
- | < | + | |
But you can do even more with interpolated strings: | But you can do even more with interpolated strings: | ||
- | + | < | |
- | < | + | |
cString := i" | cString := i" | ||
Of course you can use both at the same time: | Of course you can use both at the same time: | ||
+ | <code visualfoxpro> | ||
+ | |||
+ | As variable, not only a string variable can be used, but every type of object, and under the houd the '': | ||
+ | |||
+ | <code visualfoxpro> | ||
+ | |||
+ | cString := i"This is {oPerson}"</ | ||
+ | |||
+ | And if you wish, you can also use formatting expressions: | ||
+ | |||
+ | <code visualfoxpro> | ||
+ | |||
+ | nValue := 123.45m | ||
+ | cString := i" | ||
+ | cString := i" | ||
+ | |||
+ | In this case (as in the use with ToString()), | ||
+ | <code visualfoxpro> | ||
- | < | + | And only in the VO dialect, you need to prefix a char with the '' |
+ | < | ||
+ | Please note that there is a major difference between C# and X#: in C# all strings are enhanced, and to make them normal, you must prefix them with the '' | ||
+ | In X# all strings are normal, and to be enhanced, they need the '' | ||
strings.1516546892.txt.gz · Last modified: 2018/01/21 15:01 by wolfgangriedmann