473,805 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Remove x number of charaters from string. Vb.net

If I've got a string like x = "[00000014] Intel(R) PRO/1000 CT Network
Connection"
How do I get x = "Intel(R) PRO/1000 CT Network Connection"

I basically want to make a comparison to Intel(R) PRO/1000 CT Network
Connection, since the numeric part seems to change per system.
Aug 22 '06 #1
3 2092
Are you asking how to remove some static number of characters from the front
of a string?

In that case something like:

str = str.Substring(7 )

Will return characters 8-n, where n is the total number. Of course, if you
have less 8 characters in the string to begin with, this would cause an
exception - so you have to check for that.

"Jason" <so*****@micros oft.comwrote in message
news:OX******** ******@TK2MSFTN GP03.phx.gbl...
If I've got a string like x = "[00000014] Intel(R) PRO/1000 CT Network
Connection"
How do I get x = "Intel(R) PRO/1000 CT Network Connection"

I basically want to make a comparison to Intel(R) PRO/1000 CT Network
Connection, since the numeric part seems to change per system.

Aug 22 '06 #2
Thanks, thats what I'm looking for, and I've accounted for the exception.
"Marina Levit [MVP]" <so*****@nospam .comwrote in message
news:ew******** ******@TK2MSFTN GP03.phx.gbl...
Are you asking how to remove some static number of characters from the
front of a string?

In that case something like:

str = str.Substring(7 )

Will return characters 8-n, where n is the total number. Of course, if you
have less 8 characters in the string to begin with, this would cause an
exception - so you have to check for that.

"Jason" <so*****@micros oft.comwrote in message
news:OX******** ******@TK2MSFTN GP03.phx.gbl...
>If I've got a string like x = "[00000014] Intel(R) PRO/1000 CT Network
Connection"
How do I get x = "Intel(R) PRO/1000 CT Network Connection"

I basically want to make a comparison to Intel(R) PRO/1000 CT Network
Connection, since the numeric part seems to change per system.


Aug 22 '06 #3
I would recommend using the EndsWith method of the string instance you are
checking against :)

hth,
Mythran
"Jason" <so*****@micros oft.comwrote in message
news:uu******** ******@TK2MSFTN GP03.phx.gbl...
Thanks, thats what I'm looking for, and I've accounted for the exception.
"Marina Levit [MVP]" <so*****@nospam .comwrote in message
news:ew******** ******@TK2MSFTN GP03.phx.gbl...
>Are you asking how to remove some static number of characters from the
front of a string?

In that case something like:

str = str.Substring(7 )

Will return characters 8-n, where n is the total number. Of course, if
you have less 8 characters in the string to begin with, this would cause
an exception - so you have to check for that.

"Jason" <so*****@micros oft.comwrote in message
news:OX******* *******@TK2MSFT NGP03.phx.gbl.. .
>>If I've got a string like x = "[00000014] Intel(R) PRO/1000 CT Network
Connection"
How do I get x = "Intel(R) PRO/1000 CT Network Connection"

I basically want to make a comparison to Intel(R) PRO/1000 CT Network
Connection, since the numeric part seems to change per system.



Aug 22 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2076
by: InSeCo | last post by:
Hello, How do I count the numbers of charaters in a string/variabele? thnx, InSeCo
12
55576
by: Sam Collett | last post by:
How do I remove an item with a specified value from an array? i.e. array values 1,2,2,5,7,12,15,21 remove 2 from array would return 1,5,7,12,15,21 (12 and 21 are NOT removed, duplicates are also removed) So far I have (val is value, ar is array, returns new array):
9
52916
by: cw bebop | last post by:
Hi all Using Visual Studio C# Have a string string st = "Hi, these pretzels are making me thirsty; drink this tea. Run like heck." ******
2
12128
by: jyotish.bora | last post by:
Hi , i m trying to send a message packet to a RS232 port. I have created the handle and set the parameters. Now the general format of the packet is <STX>command<ETX><LRC> I have also written the code to calculate <LRC>. now i dont understand how to make the packet string. should i call writefile with STX, command , ETX and LRC characters differently or in a single string. can anyone give me the exact string for a command say
31
4609
by: Extremest | last post by:
I have a loop that is set to run as long as the arraylist is > 0. at the beginning of this loop I grab the first object and then remove it. I then go into another loop that checks to see if there are more objects that match the first object that i grabbed. If they match then I put them in an array. I would like to remove each match from the arraylist as I find them to speed things up and so that they don't get checked again. If I try...
9
2423
by: mistral | last post by:
Need help to remove list of days from date script. Need format "June 07, 2006" <SCRIPT LANGUAGE="JavaScript"> <!-- Begin // Get today's current date. var now = new Date();
16
7517
by: DBC User | last post by:
Hi, I have a small XML file, I uploaded to a web page. I have the following code to convert the content I downloaded from web to xml and is giving "Illegal characters in path", but when I try to see the value in XML viewer (through add watch) and is showing the content correctly. Here is the code ... string b = wc.DownloadString(myurl);
1
4448
by: pronerd | last post by:
Hi, I was wondering if any one knows of an easy way to add escape characters to an existing string in a BASH script. I have a BASH script that is failing when a string is passed with brackets "" are passed to the sed command. I am trying to put together a BASH script to create Unix safe file names. i.e. Removes spaces, special characters, etc. This fails due to the brackets. It returns "/opt/content2/Transformers_The_Album/test...
6
4261
by: falconsx23 | last post by:
I am trying to write a code for a Phone Directory program. This program is suppose to allow the user to enter a name or directory and then program can either add, save or even delete an entry. Also this program has more then one class and also uses an interface. Right now I am working on ArrayBasedPD class. I am trying to write a code for the remove method (line 158) that allows the user to enter a name, once the program sees that the name is...
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10609
Oralloy
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10360
jinu1996
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10366
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10105
tracyyun
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5542
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5677
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3845
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.