S
shapper
Hello,
I am trying to create a few String extensions that given a path, for
example:
"Contents/Image/FileName.jpg"
It provides the Path, FileName and Extension.
For example:
String fullPath = "Contents/Image/FileName.jpg";
1. String path = fullPath.GetPath();
Would return "Contents/Image/"
2. String filename = fullPath.GetFileName();
Would return "FileName"
3. String extension = fullPath.GetExtension();
Would return "jpg"
My problem is the string part not the extension creating.
How can I do this? And should I use Regex?
Thanks,
Miguel
I am trying to create a few String extensions that given a path, for
example:
"Contents/Image/FileName.jpg"
It provides the Path, FileName and Extension.
For example:
String fullPath = "Contents/Image/FileName.jpg";
1. String path = fullPath.GetPath();
Would return "Contents/Image/"
2. String filename = fullPath.GetFileName();
Would return "FileName"
3. String extension = fullPath.GetExtension();
Would return "jpg"
My problem is the string part not the extension creating.
How can I do this? And should I use Regex?
Thanks,
Miguel