Issue in Split

Hi,

Some times back i got help on split a value…
I alt: -215,29

I got help to split this so that it’s not showing the text before… and only shows the value after (:slight_smile: … like this
Split(Upd_InterestRateValue,“:”).Last.ToString.TrimStart

Now i want to split this agian so that it wont show me that - minus sign and only show me int value (price)…

I have tried using same formula by changing : to - but its not wokring…

Can some one help me…

Split(StringVariable.tostring,“: -”).trim

Var.Substring(Var.LastIndexOf(“-”)+1)

I got it my self… thanks alot for help.
But i have used:
Split(Upd_InterestRateValue,“-”).Last.ToString.Trim

Is it right what i did or wrong?

2 Likes

if you just want to remove - you can also use replace or remove method Upd_InterestRateValue.replace(“-”,“”)

This is perfect buddy
But if the value sometimes doesn’t have any minus then it will not give any output
So in that case to make it reliable use a expression like this

In the Input is stored in a variable named str_input
Then in assign activity

str_output = System.Text.RegularExpressions.Regex.Match(str_input.ToString,”(\d).*”).ToString.Trim

This will give only the numerical value even if it has minus or without minus

Cheers @Latif

I always getting this Error on regular expretion and dont know how to solv it.
I tried with ;" and with ." and with ,*" but still same error.

And i did not copy-ed your i have typed it.

System.Text.RegularExpressions.Regex.Match(Upd_InterestRateValue.ToString,“(\d).*”).ToString.Trim

I tried it still says invalid character even with .

I alt: -215,29 from this you want only number right?

yes after i know that i got value in minus then i want to check this minus value with the excel value which has no - minus sign.

Main.xaml (4.8 KB)
cheers @Latif

thanks my regular expression is working now… and i got the value out with expression. thakns Pradeep_shiva and palaniyappan

by the way… you gave me another way to solv this regular expression issue… perfect… to good brother… Have a nice day…
kindly check my other thred about DATE issue.

1 Like

sure!

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