473,382 Members | 1,665 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,382 software developers and data experts.

vb.net remove method

Hi,

I'm trying to use the remove method on a string but it doesnt seem to change
it.

name.remove(instr(name," ")-1,1)

If name = bon jovi, I would like bonjovi but I get bon jovi in the msgbox to
display it. I thought it suppose to remove the character space?

Am I doing something wrong?

thanks,
Will
Jul 21 '05 #1
4 10378
Are you assigning the answer to anything?

name = name.remove(instr(name," ")-1,1)

Chris

"wk6pack" <wk***@sd61.bc.ca> wrote in message
news:Oo**************@tk2msftngp13.phx.gbl...
Hi,

I'm trying to use the remove method on a string but it doesnt seem to
change
it.

name.remove(instr(name," ")-1,1)

If name = bon jovi, I would like bonjovi but I get bon jovi in the msgbox
to
display it. I thought it suppose to remove the character space?

Am I doing something wrong?

thanks,
Will

Jul 21 '05 #2
thanks Chris. My bad. I assumed it would place it back into name. Not
enough sleep.

thanks again.
Will

"Chris, Master of All Things Insignificant" <chris@No_Spam_Please.com> wrote
in message news:O5**************@TK2MSFTNGP09.phx.gbl...
Are you assigning the answer to anything?

name = name.remove(instr(name," ")-1,1)

Chris

"wk6pack" <wk***@sd61.bc.ca> wrote in message
news:Oo**************@tk2msftngp13.phx.gbl...
Hi,

I'm trying to use the remove method on a string but it doesnt seem to
change
it.

name.remove(instr(name," ")-1,1)

If name = bon jovi, I would like bonjovi but I get bon jovi in the msgbox to
display it. I thought it suppose to remove the character space?

Am I doing something wrong?

thanks,
Will


Jul 21 '05 #3
Remove + Instr will only remove one occurance. How about using Replace
instead of Remove/InStr?

name = name.Replace(" ", String.Empty);

That's assuming you'd want "Jon Bon Jovi" to become "JonBonJovi" rather than
"JonBon Jovi"

"wk6pack" <wk***@sd61.bc.ca> wrote in message
news:Oo**************@tk2msftngp13.phx.gbl...
Hi,

I'm trying to use the remove method on a string but it doesnt seem to
change
it.

name.remove(instr(name," ")-1,1)

If name = bon jovi, I would like bonjovi but I get bon jovi in the msgbox
to
display it. I thought it suppose to remove the character space?

Am I doing something wrong?

thanks,
Will

Jul 21 '05 #4
That'll be easier. Thanks.

Will
"Sean Hederman" <us***@blogentry.com> wrote in message
news:cv**********@ctb-nnrp2.saix.net...
Remove + Instr will only remove one occurance. How about using Replace
instead of Remove/InStr?

name = name.Replace(" ", String.Empty);

That's assuming you'd want "Jon Bon Jovi" to become "JonBonJovi" rather than "JonBon Jovi"

"wk6pack" <wk***@sd61.bc.ca> wrote in message
news:Oo**************@tk2msftngp13.phx.gbl...
Hi,

I'm trying to use the remove method on a string but it doesnt seem to
change
it.

name.remove(instr(name," ")-1,1)

If name = bon jovi, I would like bonjovi but I get bon jovi in the msgbox to
display it. I thought it suppose to remove the character space?

Am I doing something wrong?

thanks,
Will


Jul 21 '05 #5

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

Similar topics

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: Ken | last post by:
I am trying to create one image using JavaScript; then later in the script remove the image - not just remove the src. The following creates the image, but I have been unable to remove it. How...
3
by: Don | last post by:
My user control has a combobox with an arraylist attached to it along with custom add and remove methods. The "Add" method is working great. However I don't understand why the "Remove" method...
0
by: a | last post by:
I'm trying to delete an item from a collection, by clicking on a delete button in a GridView control. The item in the collection is stored in the Profile object (serialized as xml in the...
6
by: tshad | last post by:
Is there a reason to use session.remove over session.contents.remove? Don't they both remove the key and data from the contents collection? I assume that session(x) = nothing does essentially...
19
by: brasilino | last post by:
Hi Folks: I've been looking (aka googling) around with no success. I need a usability beyond 'pop()' method when removing an Array elements. For example: oName = new...
7
by: Susan Mackay | last post by:
I have a data table that is connected to a database table with a data adapter in the 'standard' manner. However I want to be able to remove selected rows from the data table (i.e. no longer...
11
by: Richard Maher | last post by:
Hi, I have read many of the copius entries on the subject of IE performance (or the lack thereof) when populating Select Lists. I don't mind the insert performance so much, (I get 100x120byte...
2
by: Nathan Sokalski | last post by:
I have an application that is using Session state. On one page, I use the Session.Add() method to create the Key/Value pair for the first time. I am then sent to another page using...
10
by: Tony Johansson | last post by:
Hello! I have a collection with a lot of object. Each object has the following definition. public class ParametermappingObj { private string Name {get;set;} private string Id {get;set;}...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.