DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: character detection

  1. #1
    Randy Guest

    character detection

    Can anyone show me how if i have a number like 6345623, i can make the
    program detect say, the fifth letter specifically, and return it in
    (console)?
    Thanks!



  2. #2
    Mike Guest

    Re: character detection

    Randy,

    below is a small example that will display the fifth letter. It can be made
    to display anything letter, based on the substring you request.

    ********************************************
    using System;

    namespace Test
    {
    /// <summary>
    /// Summary description for Class1.
    /// </summary>
    class Class1
    {
    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    [STAThread]
    static void Main(string[] args)
    {
    //
    // TODO: Add code to start application here
    //
    int x = 6345623;
    string y = x.ToString().Substring( 4, 1 );
    Console.WriteLine( y );
    Console.ReadLine(); // freezes the console until you press
    Enter
    }
    }
    }
    ********************************************
    "Randy" <anon32186@hotmail.com> wrote in message news:3d239721@10.1.10.29...
    > Can anyone show me how if i have a number like 6345623, i can make the
    > program detect say, the fifth letter specifically, and return it in
    > (console)?
    > Thanks!
    >
    >



    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.373 / Virus Database: 208 - Release Date: 7/1/2002



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center