User Tools

Site Tools


strings

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
strings [2018/08/20 03:59] wolfgangriedmannstrings [2018/10/06 05:09] (current) wolfgangriedmann
Line 29: Line 29:
  
 cString := i"This is {oPerson}"</code> cString := i"This is {oPerson}"</code>
 +
 +And if you wish, you can also use formatting expressions:
 +
 +<code visualfoxpro>local nValue as decimal
 +
 +nValue := 123.45m
 +cString := i"nValue: {nValue:######.0000}" // nValue: 123,4500
 +cString := i"nValue: {nValue:F6}" // nValue: 123,450000</code> 
 +
 +In this case (as in the use with ToString()), if you need to embed the parentheses ''{'' and ''}'' in your string, they need to be doubled as in this sample:
 +<code visualfoxpro>cConnection := i"Driver={{Microsoft access Driver (*.mdb)}};Dbq={cDatabaseFile};Uid=Admin;Pwd=;"</code>
  
 And only in the VO dialect, you need to prefix a char with the ''c'' prefix: And only in the VO dialect, you need to prefix a char with the ''c'' prefix:
 <code visualfoxpro>cChar := c'a'</code> <code visualfoxpro>cChar := c'a'</code>
 +
 +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 ''@'' character.
 +In X# all strings are normal, and to be enhanced, they need the ''e'' prefix.
  
  
strings.1534737553.txt.gz · Last modified: 2018/08/20 03:59 by wolfgangriedmann