0

Guys if i have string like that:

var tmp1 = "๐Ÿ”‘ TakeMe ๐Ÿ”‘";

Is this possible (in some easy way) to get text from that variable, but only "TakeMe"? "TakeMe" is beetwen spaces.

var tmp2 = tmp1;  

tmp2 == "TakeMe" not "๐Ÿ”‘ TakeMe ๐Ÿ”‘"

Well guys you know what i mean. Can someone help me with this? My JS skills are really bad ^^

2 Answers 2

1

you better use regex

var tmp1 = "๐Ÿ”‘ TakeMe ๐Ÿ”‘";

var [text] = tmp1.match(/[a-zA-Z]+/g);
console.log(text);

Sign up to request clarification or add additional context in comments.

Comments

0

Try this code.

var tmp1 = " TakeMe ";

var tmp2 = tmp1.trim();
console.log(tmp2);

1 Comment

It's works but only if i delete unicode icons :D That's the problem i have icons in that string. I need to ignore them and take text between spaces

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.