asp.net mvc 3 - Get file name from path -


how can split path file name 1_lighthouse_20140306143834816.jpg? , split 1_lighthouse_20140306143834816.jpg 1 reference number 1 exist.

get file name

use path.getfilename

if(countuser.length > 0) {     var file = path.getfilename(countuser[0]);     .... 

and first character resulting string using string indexer

   char firstchar = file[0];    if(firstchar == '1')       .....  } 

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -