0
New Here
,
/t5/photoshop-ecosystem-discussions/javascript-string-functions/td-p/2030786
Jul 25, 2009
Jul 25, 2009
Copy link to clipboard
Copied
Does Photoshop's implementation of javascript support the string functions such as split()? I was trying to explode the document file name by the _ character (my filename's contain alot of these). If I can't use split...is there another way to do it?
TOPICS
Actions and scripting
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
Valorous Hero
,
Jul 25, 2009
Jul 25, 2009
Yes split is supported...
var str = "This_is_a_test";
str=str.split('_');
alert(str[3]+" "+str[0].toLowerCase()+" "+str[1]);
Explore related tutorials & articles
Valorous Hero
,
/t5/photoshop-ecosystem-discussions/javascript-string-functions/m-p/2030787#M446179
Jul 25, 2009
Jul 25, 2009
Copy link to clipboard
Copied
Yes split is supported...
var str = "This_is_a_test";
str=str.split('_');
alert(str[3]+" "+str[0].toLowerCase()+" "+str[1]);
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Lehm2000
AUTHOR
New Here
,
LATEST
/t5/photoshop-ecosystem-discussions/javascript-string-functions/m-p/2030788#M446180
Jul 25, 2009
Jul 25, 2009
Copy link to clipboard
Copied
Ahh... after you wrote that I went back and reread the documentation....I was attempting to do a split function on the File object as opposed to a string. Silly me.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

