How can I get the file extension

216 views Asked by At

In MUMPS how can I get the file extension is there a class I can use? Class(%File).GetFilename that will return the Full Message name but i would just like the extension?

Set tNameIn=##class(%File).GetFilename(pRequest.OriginalFilename)

1

There are 1 answers

0
DAiMor On BEST ANSWER

You can use $piece for this.

write $piece(tNameIn, ".", *)

Should return the latest piece delimited my symbol dot
And filename without extension will be

write $piece(tNameIn, ".", 1, *-1)