.NET.... Using the Left Function.


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: .NET.... Using the Left Function.

Hybrid View

  1. #1
    Jim Guest

    .NET.... Using the Left Function.


    I'm doing the following and having trouble with the left function.

    uname = Space(255)
    sDatabase = GetPrivateProfileString("Data", "Database", "Can't be Read",
    uname, 255, "c:\databases\data.ini")
    sDatabase = Left$(uname, sDatabase)

    ----> What's the .NET way for getting the value for this. Any ideas???

    Thanks in advance..!!

    Jim

  2. #2
    Jeff Johnson Guest

    Re: .NET.... Using the Left Function.


    "Jim" <jcb1269@excite.com> wrote:
    >
    >I'm doing the following and having trouble with the left function.
    >
    >uname = Space(255)
    >sDatabase = GetPrivateProfileString("Data", "Database", "Can't be Read",
    >uname, 255, "c:\databases\data.ini")
    >sDatabase = Left$(uname, sDatabase)
    >
    >----> What's the .NET way for getting the value for this. Any ideas???
    >
    >Thanks in advance..!!
    >
    >Jim


    Try using the Substring method of the string object instead of Left$.

    j = "Hello12345"

    Console.WriteLine(j.Substring(0,5))

  3. #3
    Phil Weber Guest

    Re: .NET.... Using the Left Function.

    > sDatabase = Left$(uname, sDatabase)
    > What's the .NET way for getting the value for this?


    Jim: Just drop the dollar sign:

    sDatabase = Left(uname, sDatabase)

    --
    Phil Weber


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