Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Nov 2005
    Location
    North Canton, Ohio
    Posts
    118
    Thanks
    11
    Thanked 4 Times in 4 Posts

    c&p and what is the last char of a string

    I'm looking for three things (well, you could say two I guess).
    I'm working in the C++.NET (2005) environment, and I want to make a onclick function that will copy the string from a text box (stores it in windows clipboard or w/e so it can be used through other programs) and one that pastes what's in the clip board into a textbox.

    I'm also looking for something to check if the last character of a string is '.', and no I don't want to end up just using arrays instead of using strings.

    Any ideas?
    Thanks for future help and replies.

  • #2
    Regular Coder ralph l mayo's Avatar
    Join Date
    Nov 2005
    Posts
    951
    Thanks
    1
    Thanked 31 Times in 29 Posts
    I don't know how to work with the windows clipboard but the last character of a std::string called foo is == *(foo.end() - 1)

  • #3
    Regular Coder
    Join Date
    Nov 2005
    Location
    North Canton, Ohio
    Posts
    118
    Thanks
    11
    Thanked 4 Times in 4 Posts
    oh I guess I forgot to mention, I'm using a System::String. I don't know what the difference is, but my teacher says to always use that in .NET because of "managed code" or something like that. I'm kind of new to .NET, but I do see a stringvar->EndsWith() in the {intellisense list?}, I'm not sure if that's the same thing or not, but I'll give it a try.

    Yep, EndsWith works just fine. Thanks.
    Now I need to know how to make a copy and a paste function for my windows form app's menu.
    Last edited by Blaher; 10-09-2007 at 03:21 AM.


  •  

    Posting Permissions

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