Replace characters in Mtext's Field Expression

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
I would like to ask some Autocad filed expression questions, and here is what i need:
In Mtext, it will automatically change a symbol(_) to another symbol(/) after get part of the filename string
For example, i have a file under the path like this: //a/a/b/c/d/A23456789_B23456789_C2_D.dwg
The Mtext will show like this B23456789/C2/D
So I divide the customized field expression(according to my understanding, it means it shows automatically when i placed in the M-Text) into 2 part:
(1)(done already) the first part is to get the filename start from the 11th character and count for 14 value with following code:
%<$(substr,$(getvar,dwgname),11,14)>%
(2)After that, I would like to replace those underline symbol "_" to slash symbol "/" with following code, (which cannot work well and is my question)
%<$(vl-string-translate "_" "//" $(substr,$(getvar,dwgname),11,14))>% (<--- Can anyone help me for this)
Reference Related:
I have read several posts related to the string replacement and field expression
https://www.augi.com/articles/detail/autocad-fields-forever
Thanks,
Will