• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 251
  • Last Modified:

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

Dear experts:


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!
1 Solution
string Digit = TextBox1.Text.SubString(4,1)

Please do check the SubString function. I don't remember it exactly.
Jorge PaulinoIT Pro/DeveloperCommented:
Just a VB change to rpkhare code

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

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now