C# equivalent to Right function?

Gladimir

Well-known member
Joined
Mar 29, 2003
Messages
60
Location
San Diego, CA
Hello everyone,

Im slowly working way around c-sharp and am trying to figure out what the C# equivalent to VBs Right function might be.

I want to grab the right-most 8 characters of a string, but the best way I can see to do it is to use the string.Remove method with the string.Length property.

Is that the easiest best or is there a better way that I dont know about?
 
String.Remove is one way, but you can also use String.Substring,
specifying String.Length - 8 as the start position.
 
Back
Top