cancel
Showing results for 
Search instead for 
Did you mean: 

Adding leading spaces in a string variable

0 Kudos

Hello Experts,

I have one field in which I am accepting number from sender. The data type of that field is 'string'. I want to add blank spaces before that number.

Can you please let me know how to do that ? Do I need to write a UDF for this ?

Thanks.

Regards,

Swanand

Accepted Solutions (0)

Answers (2)

Answers (2)

arghyadg
Explorer
0 Kudos

If the Blank Space count is fixed through out, then this can be handled by normal graphical mapping using the 'Constant with the Spaces' and using Concatenate function.

If the Blank Space count varies depending upon the incoming field length once/everytime, then you have to use UDF to count the incoming field length and adding the required number of spaces.

Harish
Active Contributor
0 Kudos

Hi Swanand,

If you know how many spaces you need to add to the field and if you are using the message mapping, then just  concatenate the spaces using constant and concatenate function.

If you are not sure about the length then use UDF to handle all conditions.

regards,

Harish