Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 3rd, 2005, 08:53 PM
Registered User
 
Join Date: May 2005
Location: , , Australia.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to retrieve last selected text line in text bo

 Hi folks,

How would I achive the following. In a text box I've got a number of comma delimited records, and I want to retrieve the last record based on the first delimited item.

For example, if I've got the following rows in the text box:

  aa,123,123,123
  bb,123,123,123
  cc,123,123,123
  aa,456,456,456
  bb,456,456,456
  aa,789,789,789
  cc,456,456,456

and the row I want to retrieve is the last 'aa' row (aa,789,789,789).

Any pointers?

(BTW if it makes any difference, this is using VB.NET in the Compact Framework)

Thanks,
Gareth
Reply With Quote
  #2 (permalink)  
Old May 3rd, 2005, 09:17 PM
Registered User
 
Join Date: May 2005
Location: , , Australia.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Resolved - this did the trick:

Code:
   Private Function GetLineStartWith(ByVal txt As String) As String
        Dim arr(), ReqLine As String
        arr = Split(Me.txtStream.Text, ControlChars.CrLf)
        For i As Int32 = 0 To arr.Length - 1
            If arr(i).StartsWith(txt) Then ReqLine = arr(i)
        Next
        Return ReqLine
   End Function
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to get text of a particular cell of selected r jjkk BOOK: ASP.NET AJAX Programmer's Reference : with ASP.NET 2.0 or ASP.NET 3.5 ISBN: 978-0-470-10998-4 0 January 22nd, 2008 07:39 AM
Retrieve hidden text box value through xslt? Hannibal XSLT 1 January 29th, 2007 05:09 AM
how to retrieve text from server-side? hertendreef ASP.NET 2.0 Professional 4 June 17th, 2006 06:04 AM
Selected Text itHighway Javascript How-To 5 February 3rd, 2006 06:18 AM
is the text in text box selected? nerssi Javascript 4 September 21st, 2004 09:26 AM



All times are GMT -4. The time now is 12:37 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.