0
Engaged
,
/t5/photoshop-ecosystem-discussions/sdk-javascript-replace-ignore-case-string/td-p/12538520
Nov 20, 2021
Nov 20, 2021
Copy link to clipboard
Copied
Hey
Every tutorial/info I find usually uses "modern" javascript, but since PS is rocking one from 1990... I have no idea how to do it :- )
Can any1 let me know how to do a string replace?
var key = "hello"
var value = "Hello World"
var final = "Nice"
value.replace(/key/gi,final)
does not work.
Any hints?
TIA!
TOPICS
Actions and scripting
,
SDK
,
Windows
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
Engaged
,
Nov 20, 2021
Nov 20, 2021
Explore related tutorials & articles
Engaged
,
/t5/photoshop-ecosystem-discussions/sdk-javascript-replace-ignore-case-string/m-p/12538544#M600950
Nov 20, 2021
Nov 20, 2021
Copy link to clipboard
Copied
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Guide
,
/t5/photoshop-ecosystem-discussions/sdk-javascript-replace-ignore-case-string/m-p/12538646#M600955
Nov 20, 2021
Nov 20, 2021
Copy link to clipboard
Copied
you were very close 🙂
var key = new RegExp ("hello", 'ig')
var value = "Hello World"
var finale = "Nice"
value.replace(key,finale)
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
LATEST
/t5/photoshop-ecosystem-discussions/sdk-javascript-replace-ignore-case-string/m-p/12539171#M600992
Nov 20, 2021
Nov 20, 2021
Copy link to clipboard
Copied
Moderator please add Actions and scripting label to this thread (and delete my post).
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

