Sunday 15 January 2012

With vb.net, how can I split this filename/string? -



With vb.net, how can I split this filename/string? -

dim suffix string = "_version"

i have file called "something_version1.jpg"

i need split "something_version"

the next gets me "1.jpg"

filename = filename.split(new string() {suffix}, stringsplitoptions.none)(1)

and next gets me "something"

filename = filename.split(new string() {suffix}, stringsplitoptions.none)(0)

but need "something_version"

the suffix dynamic, , can change.

hope easier i'm making it.

thank you.

if don't care "1.jpg" part @ all, , want suffix , part before suffix, can have above (the sec one) prefix, , concatenate prefix , suffix reply you're looking for.

the split phone call might overkill job.

vb.net

No comments:

Post a Comment