string

collie

New member
string

Hi, Lets say that i have a string such as str=dog.jpg. I want to check what the value after the . is. I know that there is split, substring etc but i am not sure which method to use to return the value after the dot. Can someone please help? Thanks​
 

yuval k

New member
you can do it thus -

string extension = str.Substring(str.LastIndexOf(".") + 1); You can also do it with a Regular Expression
 
למעלה