String manipulation for finding value

Input value “(* 767000)”

Output required value is 76700

How to write string manipulation

Any suggestion will be helpful for me

Hi @satish.rathi59

Try this

Input= “*(* 767000* )”
Output = Input.Replace("(* ", "").Replace(")", "")

or

Input= “*(* 767000* )”
Output=String.Join("",Input.Where(Function(c) Char.IsDigit(c)))

or

Input= “*(* 767000* )”
Output=New String(Input.Where(Function(c) Char.IsDigit(c)).ToArray)

Hope this helps!!

grafik

Hi @satish.rathi59

You can use regular expressions to extract the required output.

- Assign -> Input = "(* 767000)"
- Assign -> Output = System.Text.RegularExpressions.Regex.Match(Input.ToString,"(\d+)").Value

The Output contains the required output.

Check the below workflow for better understanding.

image

Hope it helps!!

Hello @satish.rathi59

  1. Assign Activity:

    • InputValue = “(* 767000)”
  2. Assign Activity:

    • CleanedValue = System.Text.RegularExpressions.Regex.Replace(InputValue, “[^0-9]”, “”)
  3. Assign Activity:

    • OutputValue = Int32.Parse(CleanedValue)

Thanks & Cheers!!!