Solved

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

Posted on 2011-09-16
2
255 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 39

Accepted Solution

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

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

706 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now