[ ooxoo11 @ 25.09.2009. 10:01 ] @
Pozdrav svima

Imam dve promenljive filePath i filaName

Code:

string filePath = @"\Test\TOMA.xml";
string fileName = (filePath.TrimStart(@"\Test\".ToCharArray()));


Očekujem da fileName ima vrednost "TOMA.xml", ali dobijam OMA.xml

Gde grešim?
[ marko_81 @ 25.09.2009. 10:14 ] @
Probaj ovako:
Code:

string filePath = @"\Test\TOMA.xml";
string fileName = filePath.Substring(filePath.LastIndexOf('\\') + 1);
[ markopadjen @ 25.09.2009. 10:18 ] @
TrimStart funkcija će ići redom od početka dokle god ima karaktera koji se pojavljuju u nizu nevezano za njihov redosled.
Ti bi, npr, dobio isti rezultat i sa:

Code:
string filePath = @"\Test\TOMA.xml";
string fileName = (filePath.TrimStart(@"\tseT\".ToCharArray()));


Ono što tebi treba je:

Code:

       string filePath = @"\Test\TOMA.xml";
       string fileName = filePath.Substring(filePath.LastIndexOf(@"\")+1);
[ markopadjen @ 25.09.2009. 10:19 ] @
Kao što je u međuvremenu i napisao marko_81. ;-)
[ ooxoo11 @ 25.09.2009. 10:46 ] @
Thnx ljudi, to je to!!!!