HI Team,
Gota simple query in substring. I am looping a row and the item contains row values.
I want to print the last character in the line present in item. Thanks
HI Team,
Gota simple query in substring. I am looping a row and the item contains row values.
I want to print the last character in the line present in item. Thanks
Can you please share some sample texts and the output you want to extract?
Hi @Balan,
The suggested solution from @Srini84 will work.
I will add three other alternatives here for others who are interested.
sample = "Dynamics"
1. sample.ToArray().Last
2. sample.ToCharArray().Last
3. sample(sample.Length-1)
Output
I am extracting a row which contains text like
CNG 213 THIS IS MY NAME 12MAY2021 500.00 A
Above given text subject to change dynamically.
I want to extract the value A.
Last character A will be changing like C, P etc but it remains in the same position at the end of the line.
Use the Right function and just take 1 character.
Tried using the below suggested code, but not working, returns blank.
sample.substring(sample.length-1)
I am looping some set of rows from mainframe
item contains
CNG 213 THIS IS MY NAME 12MAY2021 500.00 A
CNG 213 THIS IS MY NAME 12MAY2021 100.00 S
CNG 213 THIS IS MY NAME 12MAY2021 300.00 C
Expected output is in each loop it should return
A
S
C
Actual is message box returning blank
Hi,
There might be whitespace at the end of the string.
Can you try to put the following just before the above expression using Assign activity.
sample=sample.Trim
Regards,