cancel
Showing results for 
Search instead for 
Did you mean: 

String is Not working

vijender_p
Active Participant
0 Kudos

Hi all,

Am working on one scenario in the which i have cut the charcter of the word it into a maximum of 25 charcter .

means the chacter of the word may be comes a single charcter word or 5 charcter word

and if the word limit exceed 25 means it should trim it into 25

please help out in this issue

Regards,

vijender.


Accepted Solutions (1)

Accepted Solutions (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Vijender,

You could use a UDF, a simple type will do.

Arguments: inp

if(inp.length()>25){

     return inp.substring(0,25);

}

else

     return inp;

Regards,

Mark

vijender_p
Active Participant
0 Kudos

Hi Mark
Thanks for the Reply ..
but Actaully when am applying the logic it is replicating error

can you please elobrate

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Vijender,

What do you mean by replicating?

Test

Regards,

Mark

vijender_p
Active Participant
0 Kudos

Thanks !!!!

its working 

Answers (2)

Answers (2)

iaki_vila
Active Contributor
0 Kudos

Hi all,

Only with standard function you can use the length function and to check if it is bigger than 25, in positive result you apply the substring function in other case you only use the source tag without do anything.

Following Mark's UDF idea you can try with Eng's code

Regards.

iaki_vila
Active Contributor
0 Kudos

Vi Vijender,

Have you tried with the substring function? Standard Functions in PI 7.0 - Process Integration - SCN Wiki

Regards.

vijender_p
Active Participant
0 Kudos

yes i have worked with the substring function ...
in that it is working when the charcter are 25 and above 25 means it is trimming .
but when the Value is less then 25 means it is not working