473,387 Members | 3,801 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 2074
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*****@microsoft.comwrote in message
news:OX**************@TK2MSFTNGP03.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**************@TK2MSFTNGP03.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*****@microsoft.comwrote in message
news:OX**************@TK2MSFTNGP03.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*****@microsoft.comwrote in message
news:uu**************@TK2MSFTNGP03.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**************@TK2MSFTNGP03.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*****@microsoft.comwrote in message
news:OX**************@TK2MSFTNGP03.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
by: InSeCo | last post by:
Hello, How do I count the numbers of charaters in a string/variabele? thnx, InSeCo
12
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...
9
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
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...
31
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...
9
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
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...
1
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...
6
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...
0
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...

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.