Click here to Skip to main content
15,886,919 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionGet a string of number ? Pin
dec8212-Mar-09 23:49
dec8212-Mar-09 23:49 
AnswerRe: Get a string of number ? Pin
Anoop Brijmohun13-Mar-09 0:47
Anoop Brijmohun13-Mar-09 0:47 
GeneralRe: Get a string of number ? Pin
Dave Kreskowiak13-Mar-09 1:16
mveDave Kreskowiak13-Mar-09 1:16 
GeneralRe: Get a string of number ? Pin
dec8213-Mar-09 2:59
dec8213-Mar-09 2:59 
AnswerRe: Get a string of number ? Pin
Eddy Vluggen13-Mar-09 0:51
professionalEddy Vluggen13-Mar-09 0:51 
AnswerRe: Get a string of number ? Pin
Jon_Boy13-Mar-09 3:39
Jon_Boy13-Mar-09 3:39 
GeneralRe: Get a string of number ? Pin
dec8213-Mar-09 5:59
dec8213-Mar-09 5:59 
GeneralRe: Get a string of number ? Pin
Luc Pattyn13-Mar-09 6:39
sitebuilderLuc Pattyn13-Mar-09 6:39 
Hi,

split the problem in a couple of smaller ones. There are at least two parts:
1. locate the "word" that contains the number
2. translate that word to a numeric value

1. depends on what you do know about the pattern in the string.
e.g. if the number is always at the end, find the last space, get the substring behind it.
if there is exactly one word plus a space in front, find that first space and look for a possible space after the number too.

2. is easy with int.Parse or int.TryParse

If you were really lazy (I wouldn't dare to assume that), split the entire string in words based on a space, then foreach "word" do a TryParse until one succeeds.

And now you are on your own I guess.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


AnswerRe: Get a string of number ? Pin
Fernando Soto13-Mar-09 4:40
Fernando Soto13-Mar-09 4:40 
QuestionDatagridview Print in VB Pin
THOBANI12-Mar-09 22:55
THOBANI12-Mar-09 22:55 
AnswerRe: Datagridview Print in VB Pin
Sebastian Br.12-Mar-09 23:19
Sebastian Br.12-Mar-09 23:19 
QuestionUse Interbase in VB Pin
ivo7512-Mar-09 21:46
ivo7512-Mar-09 21:46 
AnswerRe: Use Interbase in VB Pin
0x3c012-Mar-09 21:50
0x3c012-Mar-09 21:50 
AnswerRe: Use Interbase in VB Pin
Eddy Vluggen12-Mar-09 22:35
professionalEddy Vluggen12-Mar-09 22:35 
GeneralRe: Use Interbase in VB Pin
ivo7512-Mar-09 23:36
ivo7512-Mar-09 23:36 
GeneralRe: Use Interbase in VB Pin
Eddy Vluggen12-Mar-09 23:52
professionalEddy Vluggen12-Mar-09 23:52 
QuestionHow do i deploy MySQL Database to another computer? Pin
swaroop0912-Mar-09 20:14
swaroop0912-Mar-09 20:14 
AnswerRe: How do i deploy MySQL Database to another computer? Pin
Dave Kreskowiak13-Mar-09 1:15
mveDave Kreskowiak13-Mar-09 1:15 
QuestionSearching Sql Table for Image using byte array parameter Pin
thedom212-Mar-09 16:30
thedom212-Mar-09 16:30 
AnswerRe: Searching Sql Table for Image using byte array parameter Pin
Luc Pattyn12-Mar-09 16:47
sitebuilderLuc Pattyn12-Mar-09 16:47 
QuestionRDLC in VB.NET Pin
C#Coudou12-Mar-09 15:59
C#Coudou12-Mar-09 15:59 
AnswerRe: RDLC in VB.NET Pin
Dave Kreskowiak13-Mar-09 4:40
mveDave Kreskowiak13-Mar-09 4:40 
Questionhow can i use the system.managment librery ?? Pin
moumen2212-Mar-09 11:10
moumen2212-Mar-09 11:10 
AnswerRe: how can i use the system.managment librery ?? Pin
Dave Kreskowiak13-Mar-09 4:35
mveDave Kreskowiak13-Mar-09 4:35 
GeneralRe: how can i use the system.managment librery ?? Pin
moumen2214-Mar-09 3:08
moumen2214-Mar-09 3:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.