EndsWith

Testing parts of a string

January 22, 2011 Help
Thumbnail image for Testing parts of a string

1. The StartsWith function (an XSLT function)  is used to test whether a string starts with a given string: <<If(StartsWith(Surname,’van ‘)>><<Title>> <<Surname>> is probably of Dutch descent.<<End()>> <<If(StartsWith(Surname,’van ‘)>><<SetV(‘LastPart’,substring-after(Surname,’van ‘))>><<End()>> In previous versions this command was known as starts-with. Backward compatibility ensures that XpressDox will still recognize this command. 2. EndsWith tests the end of [...]

Read the full article →

The EndsWith Function

October 1, 2009 Help

EndsWith tests the end of a string: <<If(EndsWith(Surname,’-Smith’)>> <<Surname>> is a double-barrelled name. <<SetV(‘FirstPart’,substring(Surname,1,string-length(Surname) – 6))>><<Comment(SetV(‘FirstPart’,string-before(‘-Smith’)) is equivalent)>> <<End()>> <<Name_of_Client>><<If(not(EndsWith(ToLower(Name_of_Client),’s')))>>’s<<Else()>>’<<End()>>

Read the full article →

The StartsWith Function

October 1, 2009 Help

The StartsWith function (an XSLT function) is used to test whether a string starts with a given string: <<If(StartsWith(Surname,’van ‘)>><<Title>> <<Surname>> is probably of Dutch descent.<<End()>> <<If(StartsWith(Surname,’van ‘)>><<Setv(‘LastPart’,substring-after(Surname,’van ‘))>><<End()>> In previous versions this command was known as starts-with. Backward compatibility ensures that XpressDox will still recognize this command.

Read the full article →

The Contains Function

October 1, 2009 User Reference

Contains (an XSLT function). This command is used to test for a string anywhere inside another string: <<If(contains(Surname,’prmzl’))>><<Surname>> is not an English name.<<End()>> Read more about testing various parts of a string here

Read the full article →