Jump to content

Split a string and extract the first few characters


Ankit.Hegde

Recommended Posts

I have a requirement where in my input node, I have an input node <DateTime>Date(yyyymmdd)-Time(hhmmss)</DateTime>e.g. <DateTime>20061130093023</DateTime>The InputNode value is a string and as well as the Output. ( So I try using the functions defined to operate on strings)In my Output I need to split apart the Date Part and Time Part and Place a hard coded value over there, like 00:00:00<OutputDateTime>Date-HardCodedTime</DateTime>e.g. <OutputDateTime>20061130235900</OutputDateTime>The available functions in the string concat (is needed), substring(string,startlen) - this is not helpful is I need to extract the 1st 8 characters corresponding to date. Please can I know (asap) if any other function can be used or there is a need of a work around. Thanks

Link to comment
Share on other sites

I don't see any difference between your input and ouput :) .If the only thing you have to remove is the hyphen, then a simple translate() will do it:

translate('20061130-093023','-','')

will output

20061130093023

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...