Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Javascript String functions

New Here ,
Jul 25, 2009 Jul 25, 2009

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
5.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 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]);

Translate
Adobe
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]);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 25, 2009 Jul 25, 2009
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines