CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Tab ascii

  1. #1
    Join Date
    May 2010
    Posts
    12

    Tab ascii

    kindly help me search a string for 'TAB' (ASCII 9) in a string.

    for example string s = "123 abc". as you can see there is space between 123 and abc, and that space is created by the tab button.

    how do i search for this tab button? s.find(??????)

  2. #2
    Join Date
    Aug 2008
    Posts
    902

    Re: Tab ascii

    Quote Originally Posted by l3ecl View Post
    kindly help me search a string for 'TAB' (ASCII 9) in a string.

    for example string s = "123 abc". as you can see there is space between 123 and abc, and that space is created by the tab button.

    how do i search for this tab button? s.find(??????)
    Reading the reference should be sufficient. http://www.cplusplus.com/reference/string/string/

    string s = "123\tabc";
    size_t pos = s.find_first_of("\t");
    also tab is not a space. They are different. Use '\t' for a tab.

  3. #3
    Join Date
    May 2010
    Posts
    12

    Re: Tab ascii

    got it working, u da man
    Last edited by l3ecl; May 18th, 2010 at 11:55 PM.

Tags for this Thread

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured