String manipulating

if my string is like this format "test-exe-1.jpg" and I need to cut the left part up to first "-" and only have "test" how do I do it?
Thanks for any help..

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
miauu's picture

.

(
	str = "test-exe-1.jpg"
	resArr = filterString str "-"
	format "resArr: % \n" resArr
	firstItem = resArr[1]
	format "firstItem: % \n" firstItem
)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.