473,397 Members | 2,056 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Parsing strings to numeric

You can use a custom format specifier to format a numeric to a string... e.g
int i= 2;

string formatSpecifier = "## px";

i.ToString(formatSpecifier);

But given given a string and the custom format specifier used to format it,
how can you parse that string back to a numeric ?

I've searched the documentation yet an answer alludes me.

Michael


Nov 15 '05 #1
2 1729
"michael" <mi*****@fusiongrp.com> wrote in message
news:e1*************@tk2msftngp13.phx.gbl...
But given given a string and the custom format specifier used to format it, how can you parse that string back to a numeric ?
I may have misunderstood you needs, but can you not try somehting like :
int myNum = int.Parse( someNumString );

HTH

Tobin
I've searched the documentation yet an answer alludes me.

Michael

Nov 15 '05 #2
You might try a using the UnitConverter class or another class derived from
TypeConverter. I have never used these before, but I believe the purpose is
to parse a string that has non-parsable characters.

"michael" <mi*****@fusiongrp.com> wrote in message
news:e1*************@tk2msftngp13.phx.gbl...
You can use a custom format specifier to format a numeric to a string... e.g int i= 2;

string formatSpecifier = "## px";

i.ToString(formatSpecifier);

But given given a string and the custom format specifier used to format it, how can you parse that string back to a numeric ?

I've searched the documentation yet an answer alludes me.

Michael

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Tuang | last post by:
I've been looking all over in the docs, but I can't figure out how you're *supposed* to parse formatted strings into numbers (and other data types, for that matter) in Python. In C#, you can say...
17
by: Mark | last post by:
I must create a routine that finds tokens in small, arbitrary VB code snippets. For example, it might have to find all occurrences of {Formula} I was thinking that using regular expressions...
22
by: gene.ariani | last post by:
I have a string like the following: 10AF101-25 I would like to extract any numerical number that precedes the "-" and stops when it encounters any string character like AF So my result...
6
by: duncan.welch | last post by:
Hi, I've got a website that uses links for page positioning which works great about 99% of the time. For some reason, 1% of the time I'll get an error when parsing the querystring, as it's...
4
by: cjl | last post by:
As a learning exercise, I am trying to write a web-based version of 'drawbot' in PHP. See: http://just.letterror.com/ltrwiki/DrawBot I am interested in hearing ideas about how to approach...
9
by: KDawg44 | last post by:
Hi, I am brand new to Python. In learning anything, I find it useful to actually try to write a useful program to try to tackle an actual problem. I have a syslog server and I would like to...
1
by: =?Utf-8?B?U2FtdWVs?= | last post by:
Hi, I am setting up RegularExpressionValidators for my form elements and found no way of doing the following: 1) to validate so that Textbox.text does not contain certain phrases. e.g. I...
4
by: fafy | last post by:
Hello everybody, I'm looking for a way for parsing strings. I' ve something like this: TOTAL C00 L240 WH00 WPI00 WEI00 WPL00 TDM15359 TEMP49.76 PDIR65535 PREF65535 I28RD65535 TOTAL...
6
by: James Arnold | last post by:
Hello, I am new to C and I am trying to write a few small applications to get some hands-on practise! I am trying to write a random string generator, based on a masked input. For example, given...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.