var str = 'ashljsdbf.dsn/mdfmg/dflmg;dfjgd/fjg/jdf/gjdfgj;dfjgjdf;jf' var str_OGR = str.substr(0,6); alert(['str='+str,'\nstr_OGR='+str_OGR])