Replace in String

Hello i’m trying to use replace activity i have this variable amount = " 1.256.563" so it have a space and dots “.” so i tryed this

image

but just delete all content

i’d like to understand how to use this and with out using Replace Activity (amount.Replace([“.”," "], “”) i don’t know if this is ok but it’s just an example if you can guide me i’ll be thankful)

3 Likes

Here is the logic.
const string s = “Dot Net Perls is about Dot Net.”;

    // We must assign the result to a variable.
    // ... Every instance is replaced.
    string v = s.Replace("Net", "Basket");

Output

Dot Net Perls is about Dot Net.
Dot Basket Perls is about Dot Basket.

3 Likes

Hi @naotosx,

To format the value in custom. you can use this activity.

Regards
Balamurugan.S

Thanks @rkelchuri if i want to replace more than one character? is it possible in one setence ?

you have to take it into loop and replace different character in each cycle… that’s how you can build your own function like ReplaceAllGarbage() … :slight_smile:

also try to use Nugget package specified by @balupad14. That will address all your concerns.

1 Like

Hi Naotos,

Just put “\.” instead of “.”

Please let me know whether this works for you or not

Thanks

1 Like

Hi,

Please use the Pattern as “[^0-9]”

Thanks