+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Xploit
    Guest

    Get the string before @, from string... help pls.

    Hi everyone, i this site. I want to ask something about delphi, so if someone help me i will be really happy.

    My question is;

    I have a string like that ; opensource@hello

    I want to separite it as a 2 string. Like "opensource" and "hello". I mean, string1 will be the text before "@", string2 will be the text after "@"...

    Im waiting your helps thanks a lot!

  2. #2
    Senior Member
    Join Date
    Feb 2005
    Posts
    200
    Try this:

    var
    iniaitlString, sub1, sub2: String;
    begin

    initialString = 'opensource@hello';
    sub1 = copy(initialString, 1, Pos('@', initialString)-1);
    sub2 = copy(initialString, Pos('@', initialString)+1, Length(initialString)-Pos('@', initialString));

    end;

    PD: These are basic programming questions, not RAT related stuff, you should google things like these before posting:

    http://www.delphibasics.co.uk/RTL.asp?Name=Copy
    http://www.delphibasics.co.uk/RTL.asp?Name=Pos

  3. #3
    Xploit
    Guest
    thank u, its working...

  4. #4
    Member whit3_sh4rk's Avatar
    Join Date
    Aug 2005
    Posts
    39
    thank u to hehe.. i'm not good with strings :\

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. TxtFile 2 String? Help.
    By TruvaDonkey in forum General Programming Help
    Replies: 8
    Last Post: 14-12-2005, 00:45
  2. sending a string to a function
    By smokealot in forum Delphi Help
    Replies: 14
    Last Post: 06-10-2005, 22:34
  3. int + string trouble....
    By WEZ_2511 in forum Delphi Help
    Replies: 6
    Last Post: 01-09-2005, 13:56
  4. Searching for a string in exe.
    By ratws in forum General Programming Help
    Replies: 14
    Last Post: 27-04-2005, 22:59
  5. String--->TStrings
    By Snma in forum Delphi Help
    Replies: 0
    Last Post: 10-04-2005, 19:17

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.