String manipulation question on queue

how to get last four letters from a string?

Hi @Shravan_KV, Welcome to the Community.

You can use this:

str.Substring(Math.Max(0, str.Length - 4))

The above syntax will not throw an error if the even if the string doesn’t contain 4 characters. You can also refer to the following thread:

Best Regards.

2 Likes

Hey

Give a try with

strVar.Substring(strVar.length-4,4)

Regards

1 Like

HI @Shravan_KV

Try with this

System.Text.RegularExpressions.Regex.Match(QueueItem.SpecificContent("Columnname").Tostring.Trim,"\S{4}$").ToString

image

Regards
Sudharsan

1 Like

Hi @fernando_zuluaga ,

Thanks for the help. It worked.

Best Regards,
Shravan

Hi @Sudharsan_Ka ,

Thanks for the help. It worked.

Best Regards,
Shravan

Hi @arjunshenoy,

Thanks for the help. It worked.

Best Regards,
Shravan

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