C# equivalent to Right function?

Gladimir

Regular
Joined
Mar 29, 2003
Messages
60
Location
San Diego, CA
Hello everyone,

I'm slowly working way around c-sharp and am trying to figure out what the C# equivalent to VB's 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 don't know about?
 
String.Remove is one way, but you can also use String.Substring,
specifying String.Length - 8 as the start position.
 
Back
Top