ALI-R <al*@microsoft.com> wrote:
Sorry here is the complete code I used"
docLibName= pathFolder.Substring(pathFolder.LastIndexOf("/") + 1);
string tmpStr= pathFolder.Remove(pathFolder.Length -
docLibName.Length -1,docLibName.Length + 1);
I think I'd just use
int lastSlash = pathFolder.LastIndexOf('/');
// Do some error checking here, just in case there aren't any slashes
// or it's reached the http:// part
string docLibName = pathFolder.Substring (lastSlash+1);
string previousSlash = pathFolder.LastIndexOf('/', lastSlash-1);
// Again, do error checking
string subArea = pathFolder.Substring (previousSlash+1,
lastSlash-previousSlash-1);
string portalName = pathFolder.Substring (0, previousSlash);
Alternatively, take the substring after http:// and then use
String.Split.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too