VB 2005:  How to read a digit  from a number?

Posted on 2008-11-11
Last Modified: 2013-11-26
Dear experts:

I just learned how to read a character from a strong using the following code:

Dim strFirstNumber As String = strCardNumber.Substring(0, 1)

I wonder how to read a digit from a a number.

For example,  suppose that there is a number   78,234,596

How to read a seventh figure (which is  9)  and assign to a new variable (without converting to and from string to integer)?

Thanks a lot!
Question by:duta
    1 Comment
    LVL 14

    Accepted Solution

               string s = "78,234,596";
                      s.Replace("," , string.Empty).Substring(6 , 1);

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
    Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    755 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

    18 Experts available now in Live!

    Get 1:1 Help Now