[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

What is the most efficient way of extract the leading numbers from a string?

Posted on 2011-09-16
2
Medium Priority
?
269 Views
Last Modified: 2012-05-12
What is the most efficient way of extract the leading numbers from a string?

Example: 1020D Main Street.
Intended result: 1020
0
Comment
Question by:chuang4630
  • 2
2 Comments
 
LVL 41

Accepted Solution

by:
Kyle Abrahams earned 2000 total points
ID: 36550095
Split the line by Space
Loop through the first element until isDigit != true
0
 
LVL 41

Expert Comment

by:Kyle Abrahams
ID: 36550114
Actually just thought of a slighter faster way:

Loop from the BACK of the array to the front while isdigit = false

the rest from 0 to element is your address
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question