How to assign space to the specific location in string?

hello , everyone. Thanks for helping me.

If I have two string like “NPEP128” (7 digits)and “NPEP128H” (8 digits)

then I want to use assign activity to modify these string to all 8 digits.(add a space in the end)

after string like these "NPEP128 " (8 digits, I add a space in the end) and
“NPEP128H” (8 digits,as before)

how to write the assign activity? thanks

Hi,

Can you try the following?

String.Format("{0, -8}", text)

Regards,

2 Likes

hi @lojyehuang,

We can start by taking length and then use assign to manipulate the values


Mukesh

1 Like

@Yoichi
thanks your answer immediately.
it works!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.