XML: Displaying only part of a string - ssub

From FSDeveloper Wiki
Jump to: navigation, search

XML: Displaying only part of a string or number: ssub

Thanks go to Roelof Kruijer (AVSIM Forum, I think, 8 August 2006) and Paul EGLD (AVSIM Forum, 18 March 2011) for pointing out the correct syntax and capability of the ssub string operator (ala FS9):

'ABCDEFGHIJK' 0 4 ssub 

extracts characters starting at character 0 with a length of 4. So,

'ABCDEFGHIJK' 0 4 ssub 

results in 'ABCD', and

'ABCDEFGHIJK' 3 6 ssub 

results in 'DEFGHI', and

<String>%('Amsterdam' 2 4 ssub)%!s!%</String>

results in 'ster'.

More examples:

'ABCD123' 2 5 ssub returns the string CD123
'ABCD123' 2 6 ssub also returns the string CD123

The online SDK states only

'ab' 'abcde' ssub 

results in 'cde', which is incorrect.