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

Javascript String functions

New Here ,
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

Views

5.0K

Translate

Translate

Report

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

Votes

Translate

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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