/    Sign up×
Community /Pin to ProfileBookmark

How to solve this logic in javascript

can anybody solve this
1) How to convert this “9x999y98z44w999”; into [[9],[999],[98],[44],[999]] using JavaScript

2) Convert
“a+b-c/10” into [a, b, c, 10]

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@NogDogJun 26.2019 — Maybe try https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split and scroll down to the example that uses a regex as the separator?
Copy linkTweet thisAlerts:
@sagarchavadaJun 27.2019 — My point of view you have to save Regex in your code using Regular Expression you can simplified your code it have you to solve your issue in your code. this is link how to set Regex in your code:

[https://www.w3schools.com/js/js_regexp.asp](url)

[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions](url)

[https://www.regular-expressions.info/javascriptexample.html](url)
×

Success!

Help @sai401 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.23,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...