Products Downloads


French version


 

This function compares two alphanumeric strings by comparing the coding values of each character.

It returns 0 if the two strings are the same (the comparison is case sensitive). It returns a value lower than 0 if the first string is strictly lower than the second. It returns a value higher than 0 if the first string is higher than the second.


Parameters

String

stringVal1

Alphanumeric string to compare

Mandatory

String

stringVal2

Alphanumeric string to compare

Mandatory

 


For example

<#assign stringVal1 = "foo" />
<#assign stringVal2 = "bar" />
<#assign compare = hardisCore.lexicographicCompareString(stringVal1, stringVal2) />
<#if compare == 0>
${stringVal1} equals ${stringVal2}
<#elseif compare > 0>
${stringVal1} is greater than ${stringVal2}
<#else>
${stringVal1} is less than ${stringVal2}
</#if>