473,395 Members | 1,678 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,395 software developers and data experts.

Formatting Phone Number.

If I have a string with an unformatted phone number (ie. 1234567890) what is
the easiest way to copy it into a string as a formatted number (ie.
123-456-7890).

Thanks,
Mike
Nov 20 '05 #1
1 1415
* "Mike Lambert" <Mi*******@hotmail.com> scripsit:
If I have a string with an unformatted phone number (ie. 1234567890) what is
the easiest way to copy it into a string as a formatted number (ie.
123-456-7890).


You can use 'Mid' to cut out parts of the string and then build the new
string using 'String.Format' or the '&' operator.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

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

Similar topics

3
by: Shay Hurley | last post by:
this is probably a stupid question so apologies in advance. I am trying to format a number to look like a phone number with "-"'s between the numbers etc e.g. 15554256987 should be formatted as...
1
by: Yama | last post by:
Hi, I am writing a windows form that will query the database. string query = "SELECT TOP 2 * FROM Northwind.dbo.Customers" ; DBQuery Q = new DBQuery() ; bool result =...
7
by: ilona | last post by:
Hi all, I store phone numbers in the database as 123447775665554(input mask is used for input, and some numbers have extensions), and I also know from db if the number is Canadian, US, or some...
0
by: KentEMon | last post by:
I have a field in my SQL database table which has phone numbers stored with no "-" character. That is, 4540090 rather than 454-0090. I have a webform datagrid and wish to display these values in a...
1
by: womblesjc | last post by:
I have a data bound Details View control in asp.net 2.0 that formats a phone number. The 'Default Mode' for the control is set to Edit. The phone number field is a template field and I can...
7
by: L. Scott M. | last post by:
Have a quick simple question: dim x as string x = "1234567890" ------------------------------------------------------- VB 6 dim y as string
2
by: dcyale | last post by:
I have a report with the following paragraph: ="This BA presents a " & & " determination for the " & & " and associated habitat. We would appreciate you processing the biological opinion by " &...
2
by: Zim Babwe | last post by:
I have an unbound DataGrieView on a Windows form (VS 2005) and I have added a column to a DataGridView Dim textCol As New DataGridViewTextBoxColumn textCol.Name = "ContactPhone1" ...
4
by: Blue Streak | last post by:
Hello, Folks! Does anyone know of a website that lists the local phone number formats for each country? TIA...
6
by: Jack | last post by:
Hi there, Given a standard .NET string, does anyone know what the regular expression would be to locate each (optional) formatting item in the string (or more likely does anyone have a link that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.