Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 18th, 2007, 01:00 AM
Authorized User
 
Join Date: Jan 2007
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to extract words from a string in VB.NET?

I want to split this string
s.WriteLine("<a href=ConsoleApplication1.exe?PFolder=oPFolder&SFol der=sfolder&oMsg=i>")

 and want to extract "oPFolder,sfolder and i" from above string.How can do it in VB.NET?



 
Old January 18th, 2007, 01:40 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Dim sTemp as string = "<a href=ConsoleApplication1.exe?PFolder=oPFolder&SFol der=sfolder&oMsg=i>"

sTemp = sTemp.Remove(0, sTemp.IndexOf("?"))
'Your string now looks like this: PFolder=oPFolder&SFolder=sfolder&oMsg=i

Dim sArray() as String = sTemp.Split("&")

'Your array now looks like this:
0 PFolder=oPFolder
1 SFolder=sfolder
2 oMsg=i

Now its just simple string manipulation to remove everything before the =

================================================== =========
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
================================================== =========
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
String Utils to search all words in filenames sbc789 JSP Basics 1 December 7th, 2008 10:39 PM
Trying dbf file to extract in vb.net 2002 kau_shuk VS.NET 2002/2003 1 November 9th, 2006 09:06 PM
Extract first numeric string blkskullwork Javascript 1 November 6th, 2006 02:37 AM
how to extract from a string fraijo SQL Server 2000 3 October 25th, 2006 09:55 PM
How to extract a substring from a string.... muralish MySQL 2 May 18th, 2005 06:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.