hi i have this variable which looks like this ؛ 002005 And i want to split it into two halfs three each . What i want to do is to put the first 3 numbers in a new variable and to remove its starting zero padding to get only 2 and the second half also to get just 5
Thank you very much
any help woild be apreciated
shandoosheri
0
Light Poster
Recommended Answers
Jump to PostI'm no expert at js - here's a start. Doubtless, there will be a better way to do it...
var str = '002005'; var bits = str.match(/.{1,3}/g); alert(parseInt(bits[0])); alert(parseInt(bits[1]));
All 5 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.