|
From: ivana r. <iva...@mf...> - 2018-03-26 17:01:00
|
Hi Patrick, if you don't wanna to call system commands, see "String functions" manual section: -- if you are sure to have the 3-letters extension than you can simply write > myvar=filename[1:strlen(filename)-4] -- if you are satisfied with the filename shortage to the first dot if exists than you can simply write > myvar=filename[1:strstrt(filename, ".") - 1] -- if you wanna be sure to remove just the last dot if exists than you can write > f(n,a)=(_n=n, _a=strlen(a), _f=strstrt(a[_a-_n:_a], "."), _f||(_a==_n)?a[1:_a-_n-1]:f(_n+1,a)) > myvar=f(0,filename) Sincerely Iva |