One Star

substring function

Hi Guys,
I have a question regarding substring function. I am trying to extract first 3 characters from column.
Following is the function i am using. StringHandling.substr(DSLink3.col1,1,3). I am getting error.
Thanks for help

  • Data Integration
2 REPLIES
Employee

Re: substring function

Hi skatpally,
You can do the following:
DSLink3.col1.substring(0,3).
In Java, the index of the first character is 0, not 1.

Re: substring function

how can i select a string that comes out of the component: tRESTClient for example?
i tried things like tRESTClient.row1.substring(0,5) in tJava component but that doesn't work..the error i get = tRESTClient cannot be resolved
the problem is that the string contains five characters at the beginning of the string that don't belong there.. so i want to remove the five first characters in that string (JSON) so it will be valid in combination with the next component (tExtractJSONFields)