Replace in String


#1

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)


#2

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

Hi @naotosx,

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

Regards
Balamurugan.S


#4

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


#5

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.