What's new

String Find and Replace in Creator Tools

Hi there,

Yaron from the Kontakt Platform team here.

You can simply do something like this:

replaceString = "replaceMe"
replaceWith = "myNewName"
oldName = instrument.groups[0].name
instrument.groups[0].name = oldName:gsub(replaceString, replaceWith)
 
Hi Yaron,

Thanks, but I'm looking for a kind of search and replace method.
I'm new to Lua and finding it a bit confusing.



Something like this: search all group names, IF any contain the string "Red 5", replace that part of the name with "Blue 8". So a group named "Piano C3 Red 5 Release" will be renamed "Piano C3 Blue 8 Release".



cheers
Dan
 
Oh ok, thanks Mario. I'll give it a try in the morning.

I'm used to KSP, that just looked too brief. ;)
 
Top Bottom