Skip to content

Use part of filename in prompt #120

Answered by ThereforeGames
vassijoseph asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @vassijoseph,

You'll want to take a look at the [substring] shortcode - I just updated it to accept arbitrary strings for the start and end values.

So if your filename is somepicturename_01.png you can retrieve somepicturename as follows:

[substring end="_"]somepicturename_01.png[/substring]

This may work for slicing a directory name out of a string as well, although it depends on how your paths are formatted.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@vassijoseph
Comment options

Answer selected by vassijoseph
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants