How do I remove the “[” “]” brackets if I want to change the file name with Templater and the value of a frontmatter entry from another file is to be used?
Things I have tried
in my frontmatter is an entry:
---
projekt: projekt_with_a_pretty_long_title__1
projCode: abc123
objekttype: Projekt
---
in the template I try via templater
<%* const dv = this.app.plugins.plugins["dataview"].api;
let projects = dv.pages();
let all_projects = projects.where(p => p.objekttype == "Projekt").sort(n => n.name);
let akTitle = all_projects.projCode;
but when I try to rename the file with the akTitle
variable via:
<% tp.file.rename(akTitle + "-"+ tp.date.now()) %>
the filename goes:
[abc123]-2022-10-10
how can I remove those brackets?