0

I have an array with one element

ClickMeArray[0] = "ClickMe=a-6,a-7,a-8,a-9,"

I want variable to return elements after ClickMe= from ClickMeArray.

Output should be a-6,a-7,a-8,a-9,.

2
  • If the "ClickMe=" is always the same you can use .substr(8) in order to offset the first chars. Commented Sep 2, 2016 at 17:36
  • is it always the same string or can it be other words followed by =? Commented Sep 2, 2016 at 17:36

3 Answers 3

2
ClickMeArray[0].split('ClickMe=')[1];
Sign up to request clarification or add additional context in comments.

Comments

1

Try This

var val = "ClickMe=a-6,a-7,a-8,a-9,"; 
var myString = val.substr(val.indexOf("=") + 1);

Comments

0

There are many way to do this work. One way is using .replace(). You can replace ClickMe= with empty to getting another part of string.

var ClickMeArray = "ClickMe=a-6,a-7,a-8,a-9,";
console.log(ClickMeArray.replace('ClickMe=',''));

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.