Hai friends...
In our Organization... we have regno...like 06AKK012 06AK012 06A012
Now my question...when ever user enter regno.. I want to Extract..till last alphabetic charcter of regno...
for example.. 06AKK012 => 06AKK
06AK012 => 06AK
06A012 => 06A
is there any option.....
give me coding what we write.... in webform.aspx.vb ....
Thank u...
Davidson..
7 1181 Plater 7,872
Recognized Expert Expert
Well if you treated the string as a char[] (which it is in a way) and start sliding to the left, using .IsLetter().
As soon as it says yes, set a boolean value. When it finds a "non letter" after the boolean has been set (so you know it has made it through the alphabetic characters). you can exit out of the loop and return the index that you were on in the char[].
Thank u plater..
can u give me coding...in asp.net(vb language)
what we write in webform.aspx.vb
Davidson.......
Thank u plater..
can u give me coding...in asp.net(vb language)
what we write in webform.aspx.vb
Davidson.......
You could go clever and use the Split function with a regex.
Thank u r035...
if u give sample coding....it will be understandable. ...
please...
U can convert string to character array and then check character is letter.
like this
Dim c() As Char
Dim i,flg,pos as Int16
flg=1
c = str.ToCharArray
for i=0 to c.length
if flg=2 and c(i).Isnumaric( ) then
pos = i
exit for
end if
if c(i).IsLetter() then
flg=2
end if
next
substring the string upto pos
Plater 7,872
Recognized Expert Expert
if you have a string, you can refer to it just like an array, no need to call .ToCharArray() for it.
How about -
Imports System.Text.RegularExpressions
-
Module Module1
-
Sub Main()
-
Dim regNo As String
-
regNo = "06AK012"
-
Dim r As Regex
-
r = New Regex("\D")
-
Dim s As String() = Nothing
-
s = r.Split(regNo)
-
Dim t As String
-
t = regNo.Substring(regNo.IndexOf(s(s.Length - 1)))
-
Dim v As String
-
v = regNo.Substring(0, regNo.IndexOf(t))
-
MsgBox(v)
-
End Sub
-
End Module
Washes mouth for writing VB
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Greg |
last post by:
Hi.
I am writing an INTRAnet app using asp.net/VB that, amongst other things,
needs to access the global address list in Outlook, extract some email
addresses and send email to these people.
(actually, I believe I will have to be using Outlook's Web client).
I am spending vast amounts of time trawling unsuccessfully thru MSDN and
Help...
|
by: John Howard |
last post by:
Where can I find a good explination and example of using VB.Net/ASP.net to
browse an MS Access database using ADO.Net?
Thanks in advance,
John
|
by: ASP .NET Newbie |
last post by:
How can I run a WebBrowser control using ASP.NET/VB.NET? I know I can use
the WebClient to get the page data, but I need to be able to use the
WebBrowser (AxWebBrowser)?
Thanks,
Chad
|
by: Jerome Cohen |
last post by:
I need to implement a simple application that listens for web requests on a
well-known URL, grab the request , which is an XML document, and send as
respnse an XML document.
each client sends a first request and I return failure or a session ID which
I store, and further requests should have the session ID.
isn't there a sim[ple way to do...
|
by: James |
last post by:
So far, is basically dispise ADO.NET & VB.NET. Here's why:
Too many confusing ways to do simple things. Here are two
examples that maybe someone can help me with:
(1) I have TextBox controls on a form bound to Date fields
in a DataSet. Works great, except that when the TextBox
fields lose focus, when their Text paramter is a Date, the...
| |
by: S. Ahmed |
last post by:
Hi all:
I am new to VB, especially to VB .NET. I need to create an ActiveX DLL
that I can then use in another application (LabView). I know in VB
6.0, creating ActiveX DLL was easy. The documentations says, 'class
library' now replaces ActiveX DLL. Also, someone told me that an
ActiveX DLL can be exported from .NET VB.
I would really...
|
by: Henry |
last post by:
Is there a way in ASP.NET/VB.NET to get the current form name. I'd like
to store the name in a session variable for use on an Error page and use
it to return to the page that had the error.
Tks for any input.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
|
by: ARJOBS.CO.IN |
last post by:
Hi
MNC based at noida is conducting a grand for the following
technology domains :
o ASP.Net, VB.Net or C# and Oracle
o Experience : 3 + years
Date: June 9, 2007
Time: 10 AM to 2 PM
To know details pls visit http://www.arjobs.co.in/job_details.php?jobid=913
Thanks
|
by: venkat6725 |
last post by:
hi,
how to use the asp.net ajax in all the web forms migrated from (asp.net,vb.net,2003) to (asp.net,vb.net,2005)
needs clear description
thanks
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |