hi all...
i have got arequirement where in i need to take out the file names alone from a given string... i thought of using indexof function but not sure of its exact usage...
eg
there are two paths like this
str="c:\windows \temp c:\windows\dir"
i need to get the file names alone as outputs that is temp and dir...
i tried giving the index of fuction like this but its not working
int len
len=str.indexof (" ")
string str1
str1=str.substr ing(0,len)
but this code is not working...can anyone suggest me a solution..
wiill be thankful to whatever help i get
thanks
sairaam
i have got arequirement where in i need to take out the file names alone from a given string... i thought of using indexof function but not sure of its exact usage...
eg
there are two paths like this
str="c:\windows \temp c:\windows\dir"
i need to get the file names alone as outputs that is temp and dir...
i tried giving the index of fuction like this but its not working
int len
len=str.indexof (" ")
string str1
str1=str.substr ing(0,len)
but this code is not working...can anyone suggest me a solution..
wiill be thankful to whatever help i get
thanks
sairaam
Comment