How to use substring-before operation in String Function Using XPath in Xml

In this article I will explain substring-before operation of string function.
  • 1970

Introduction

The String's substring-before function can be used to find the substring within the string and return the string that comes before the substring, that we specify in the argument. This function takes two arguments and returns the substring of the first string argument that precedes the first occurrence of the second argument string. If the substring not matches than it return the empty string.

Syntax

string substring-before(string,string)

Hear substring-before is a function that takes the string argument and return the substring before the string.

Example

substring-after("23/01/2012","/")
substring-after("23/01/2012","01")
substring-after("23/01/2012","5")

Output

The output of the above function is as,

"23"
"23/"
" "

Ask Your Question 

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

Programming Answers here

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.