getting value from string (VB .net)

Hi

Just a quickie (i hope) - i'm trying to get a value from a string but not sure what method to use.

Eg

Dim myString As String = "(ng) nottingham"

How would i get the value between the parentheses - ng?  The values are either going to be a single or two characters if this helps?

I can think of a work around using myString.IndexOf() but i'm sure there must be a specific function for this problem?

 

thanks
 

0
mattock
1/9/2007 11:03:16 AM
asp.net.visual-basic.net 3721 articles. 0 followers. Follow

2 Replies
983 Views

Similar Articles

[PageSpeed] 16

Hey,

You could loop through the three or four characters, use the Substring method and trim/remove the parens, or you can use regular expressions.


Brian

"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
0
bmains
1/9/2007 12:28:07 PM

got there in the end with regex!

 

Dim myString As String = "newcastle (nc)"
Dim insideParentheses As String = Regex.Match(myString, "\([a-z]{1,3}\)$").Groups(0).ToString()
Response.Write(insideParentheses)
 
  Cheers
0
mattock
1/9/2007 4:09:34 PM
Reply:

Similar Artilces:

Sending SMS using vb.net or C#.net using vb.net or c#.net
Hi  My requirement is I hav one csv file with these fields id,mobilenum,messgae,status.intiallu staus is 0. once i read the all fileds and take that mobile number.using tat mobile number  i need to send sms .after sending sms i shuld change status as 1 How to send sms thru coding (please dont provide any links.if it is provide also please give working links becox i checked codeproject .i didnt get any nice link. and also provide the how to update the status field im csv file   Thank ssandhya   To send SMS, you need some third party SMS providers. if you consul...

Visual Studio .Net? Visual Basic .Net?
Okay, I admit it -- I know nothing about .Net. I'm a Visual Basic and ASP developer. DotNetNuke is my first tentative step into the whole ".Net Thing", and I'm looking for some advice... What do I really need to be able to make some modifications, or new modules for DotNetNuke? Do I need the full, THOUSAND DOLLAR Visual Studio .Net 2003 package, or can I get away with the HUNDRED DOLLAR Visual Basic .Net Standard package?Chameleon Systems, Inc. You can use webmatrix, available here for free. One of the drawbacks of webmatrix however is that it does not support code-be...

Visual Basic.NET or Visual Studio.NET?
OK, this has probably been asked before... I'm a student looking to cut my costs, and I can do this by just purchasing Visual Basic.NET as opposed to the fully-fledged Visual Studio.NET application. Of course, I'll only be able to program in VB, but that's fine with me. I wanted to know if all of the ASP.NET specific options are available, such as using a WYSIWYG editor? I'd also like to know if VB.NET has IntelliSense, or that's a specific option only available to Visual Studio.NET users. Thanks in advance. I'd have to believe that VB.Net has intellisense. What is the price d...

What are the diff. visual basic 6 and vb.net ? How to convert the VB6 project to vb.net proj ?
What are the diff. visual basic 6 and vb.net ? How to convert the VB6 project to vb.net proj ? with code and interface too. There are entire forums dedicated to the differences between the two, and to convert your projects you should try the upgrade wizard in Visual Studio....

Visual Basic.NET or Visual Studio.NET? #2
I am currently using the Web Matrix to develop ASP.NET applications, but I am keep to upgrade to VS.NET. However, I can't justify spending $1,000 at the moment. I then found the MUCH cheaper "Visual Basic .NET 2003 Standard Edition" which is only $100. I have very little C# knowledge, and use Basic almost all the time. Would this be a good tool to use for web development? Does it support all the code behind stuff that VS users love so much? Thanks!! I use "VB.NET Standard Edition" and I'm happy with it. It has exactly the same features as Visual Studio.NET. Th...

Visual Studio.Net and VB.Net
Can we install VS.Net and VB.Net on the same machine and work side by. Is there any thing I need to worry about? I use VS.Net enterprise for my office work and I am planning to buy VB.Net standard for my personal use. Before I goahead and buy, I wanted to make sure that it works. Thanks for your help. Anil...

converting to vb.net from c#.net authorize.net
authorize.net offered me some sample code when I signed up with them the only problem is the sample code is in c#.net but my page that they type all of their credit card into is vb.net <code><%@ Import Namespace="System.Net" %> <%@ Import Namespace="System.IO" %> <script language="C#" runat="server"> void Page_Load(Object Src, EventArgs E) { myPage.Text = readHtmlPage("https://certification.authorize.net/gateway/transact.dll"); } private String readHtmlPage(string url) { ...

Visual Basic .NET 2003 vs Visual Studio .NET 2003
Hi, If im going to be coding my ASP.NET in just VB.NET then would I be able to go for the cheaper option of buying Visual Basic .NET 2003 ?? - Carl S Yes.Starting with ASP.NET 2.0? Look at:Programming Microsoft Web Forms My Blog Are there any limitations if I was doing my ASP.NET with VB.NET in Visual Basic .NET 2003 than if I was using the full Visual Studio .NET 2003 ?? Or are the only advantages of Visual Studio .NET 2003 in that it supports more programming languages ?? - Carl S You should check the MS Web site, but I believe that, given an edition (Standard, Professional...

Net:Net:Net::LDAP::FAQ
------_=_NextPart_001_01C6429F.D89AA417 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello, Net::LDAP Net::LDAPS Is there a possible to LDAP bind with an encrypted (SHA, SSHA, CRYPT, ....) password? I don't like to write the secret password to the perl file. Best regards Barbara Wilbert ------_=_NextPart_001_01C6429F.D89AA417-- Wilbert Barbara (CI/OSI) * wrote: > Hello, > > Net::LDAP > Net::LDAPS > > Is there a possible to LDAP bind with an encrypted (SHA, SSHA, CRYPT, > ......

vb.net vs c#.net vs j#.net
just out of curiousity which looks, acts most like java? i'm still learning trying to used to vb.net but it seems that it was easier to do some stuff with java. C# is Java++ in my opinion. If you have done C or Jave you will prefer C#.Mike Schellenberger - MCAD If you are looking for language similar to java go for J#. However most code samples you find on the net will be in VB.NET and C#....

How to get RS (From VB6) to .NET (VB.NET)
Hi Friends,         I have requirement, there is one function in VB6 it returns a RS, I need to call that function in  VB.NET, how to get those values into .NET, if can any body can help (pass me some code snippets), that will be greate, Thank you.Madhu... -Madhu hey guys i got this one just by using fill method.-Madhu...

ADO.NET Programming in Visual Basic .NET
Has anyone read "ADO.NET Programming in Visual Basic .NET, Second Edition" by Steve Holzner (Author), Bob Howell (Author)? I am trying to working on a project and there are a few things that I need to tie up quickly in my web forms. Is this book a good one? karls------------------------------------'Old and wrinkled is not what I expected to become when I grew up!'...

use VB.NET and C#.NET code in the same C#.NET project
All-- Here is a sample that is "off the beaten path", (at least for me). Is it possible, in an ASP.NET application, using the code-behind page building technique, to have both pages written in VB.NET and pages written C#.NET?At http://www.WebLogicArts.com/DemoList.aspx there is a sample that shows that, (contrary to popular belief), it IS possible to mix ASP.NET pages built with C#.NET with ASP.NET pages built with VB.NET in the same VS.NET 2003 project. Note that this is just a "fun" sample to see if it can be done and I do not recommend this practice as a "standard" way of develo...

Visual Studio.NET VB.NET Edition for DNN?
I have been plugging along using the Handcoded method for Module Development up to this point and although I have been successful I'd like to possibly make the jump up to Visual Studio. I was looking at Microsot's Website and there is a VB.Net only version that lists for only $109 vs. the $1000+ for the full fleged Professional Edition. Is it possible to adequately develop for the DNN platform using this trimmed down (VB.NET only) version of Visual Studio 2003? The VB.NET 2003 package is more than adequate for DDN moodules or full-blown ASP.NET applications. Highly recommended... mi...

Web resources about - getting value from string (VB .net) - asp.net.visual-basic.net

Larwyn’s Linx: GOPe Cozying Up to Trump to Stop Cruz
Send us tips ! Bloggers: install a Larwyn's Linx widget . Get real-time news, 24/7, at BadBlue . Nation They Fear Cruz This Much: GOPe Cozying ...

Burkina Faso hotel siege declared over
At least 27 killed, including four assailants, and 126 freed as standoff ends, but operation continues at nearby hotel.

‘Game Of Thrones’ Queen Of The Dragons Emilia Clarke Teases ‘Big Moments’ In Season 6 And The Return ...
With the new season of Game of Thrones only months away, fans are eagerly waiting for any spoilers concerning the fate of one Jon Snow (Kit Harington). ...

Recommended Reading: The brilliance of David Bowie
'Heroes,' Heavenly Bodies and David Bowie's Untouchable Brilliance Bomani Jones, Playboy I've followed the work of ESPN's Bomani Jones long enough ...

Taiwan elects new nationalist president, threatening China relations
It’s getting hard to keep track of all the international news this week, what with so much of the world being on fire and all, but there was ...

Bill Maher Petitions President Obama To Appear On ‘Real Time With Bill Maher’ – And Thousands Of Viewers ...
Bill Maher fans (nearly 30,000 and counting) have answered the talk-show host’s call to arms — or, more accurately, call to fingers — by typing ...

Bernie Sanders Beating Hillary Clinton on Broadcast TV
Bloomberg Bernie Sanders Beating Hillary Clinton on Broadcast TV Bloomberg After months of having the airwaves to herself, Hillary Clinton ...

JohnAndLisaGiveBack.com Scam? Are Powerball Winners John And Lisa Robinson Giving Back Money Through ...
The scam website johnandlisagiveback.com is getting plenty of attention, with its claims that the “Powerball Winners are Giving Away Cash To ...

Wal-Mart to close 154 stores in the US
Wal-Mart is closing 154 stores in the U.S. and another big chunk in its challenging Brazilian market.

‘Star Wars: The Force Awakens’ — Debunking The Theory Of Who Exactly Is Rey’s Father
While Star Wars: The Force Awakens left fans with plenty to think about, one question remaining centers on the identity of Rey’s (Daisy Ridley) ...

Resources last updated: 1/16/2016 4:44:12 PM