How to use compare operation in String Function Using XPath in Xml

In this article I will explain compare operation of string function.
  • 2752

Introduction

The compare operation of string can be used to compare the string in the compare function. This function has two argument or the two string ,If both the strings are equal then this function return 0, if the first string is less than the second string then it return -1 and when the first string is greater than the second string then it will return 1.

Syntax

compare (string , string)

Example

compare ("abcd" ,"abcdef")
compare ("abcd" , "ab")
compare ( "ab","ab")

Output

-1
 1
 0

Further Readings

You may also want to read these related articles.

Ask Your Question

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.