This is the if condition:
withoutMoney.Substring(0,withoutMoney.IndexOf(year, withoutMoney.IndexOf(year)+1)+year.Length)
This is the code: Left(withoutMoney,withoutMoney.Tostring.LastIndexof(year)+4)
withoutMoney is a string variable.
year is a string variable to get the date(DateTime.Now.ToString(“yyyy”))
This is an example of line that is suppose to pass through if condition and my code.
S|Compute|Service(JYAZ,|4|vCEU|8UB,|99.5%)|01|May|2018|to|31|May|2017|1,094.74
The expected outcome was S|Compute|Service(JYAZ,|4|vCEU|8UB,|99.5%)|01|May|2018|to|31|May|2017|
if Input is : S|Compute|Service(JYAZ,|4|vCEU|8UB,|99.5%)|01|May|2018|to|31|May|2017|1,094.74
and output is : S|Compute|Service(JYAZ,|4|vCEU|8UB,|99.5%)|01|May|2018|to|31|May|2017|
you can do withoutMoney.Substring(0,withoutMoney.Tostring.LastIndexof(“|”)+1)
Could you clarify something for me? I am a bit confused by your IF statement with a .Substring method and its purpose.
If the entire IF statement looks like this:
Then I am not sure how you managed to use a String value in that IF statement without a syntax error, for example for me it gives an error about conversion from String to Boolean:
Could you clarify the purpose of this IF statement? Maybe I am missing something
Hi, sorry this is how my if condition looks like:
withoutMoney.Substring(0,withoutMoney.IndexOf(year, withoutMoney.IndexOf(year)+1)+year.Length).Length > 50