?
Solved

VB 2005:  How to select a digit from a number and assign it to a new variable?

Posted on 2008-11-11
2
Medium Priority
?
245 Views
Last Modified: 2013-11-26
Dear experts:

Hi!

I would like to learn how to select a digit (5) from a   7-digit number like "2345678", and
assign the selected digit (5) to a new variable.

Thanks a lot!
0
Comment
Question by:duta
2 Comments
 
LVL 8

Expert Comment

by:rpkhare
ID: 22936871
string Digit = TextBox1.Text.SubString(4,1)

Please do check the SubString function. I don't remember it exactly.
0
 
LVL 48

Accepted Solution

by:
jpaulino earned 2000 total points
ID: 22937725
Just a VB change to rpkhare code

Dim str As String = "2345678" 
Dim digit As String = str.Substring(3, 1)
 

Open in new window

0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
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. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

807 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