473,320 Members | 2,117 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,320 software developers and data experts.

Remove last letter from string

Hello,

I am trying to remove the last letter from a string:
names.Remove(names.Remove(names.Length - 1, 1))

I get index out of range. What am I doing wrong?

Thanks,
Miguel

Oct 22 '07 #1
2 2981
"shapper" <md*****@gmail.comwrote in message
news:11*********************@q3g2000prf.googlegrou ps.com...
I am trying to remove the last letter from a string:
names.Remove(names.Remove(names.Length - 1, 1))

I get index out of range. What am I doing wrong?
names.Remove(names.Length - 1, 1)
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 22 '07 #2
On Oct 22, 5:02 pm, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:
"shapper" <mdmo...@gmail.comwrote in message

news:11*********************@q3g2000prf.googlegrou ps.com...
I am trying to remove the last letter from a string:
names.Remove(names.Remove(names.Length - 1, 1))
I get index out of range. What am I doing wrong?

names.Remove(names.Length - 1, 1)

--
Mark Rae
ASP.NET MVPhttp://www.markrae.net
Ooops, sorry ... that what happens when using to many Copy Paste.

Thanks,
Miguel

Oct 22 '07 #3

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

Similar topics

11
by: steve smith | last post by:
Hi I'm still having some problems getting my head round this language. A couple of things don't seem to work for me. First I am trying to obtan a count of the number of words in a sting, so am...
11
by: deko | last post by:
I need to loop through a string and remove all characters except numbers or letters. I am getting an ArgumentOutOfRangeException: "Index was out of range. Must be non-negative and less than the...
10
by: Brian Gruber | last post by:
Hi, I'm looking for a way to rename a whole directory of files in short order. The files in the directory have different lengths, however all of them end with _xxxx the x's represent a randomly...
6
by: Daniel Mark | last post by:
Hello all: I have the following snippet: In : fileName = 'Perfect Setup.txt\n' In : fileName = fileName # remove the '\n' character In : fileName Out: 'Perfect Setup.txt'
34
by: Registered User | last post by:
Hi experts, I'm trying to write a program that replaces two or more consecutive blanks in a string by a single blank. Here's what I did: #include <stdio.h> #include <string.h> #define MAX 80
3
by: Harry Haller | last post by:
What is the fastest way to search a client-side database? I have about 60-65 kb of data downloaded to the client which is present in 3 dynamically created list boxes. The boxes are filled from 3...
2
by: lekshminair | last post by:
dears can u help me remove last letter in a string. eg: arises in this string remove only last 's' ouput:arise
9
by: Ulterior | last post by:
Hi, everyone, I have a simple problem, which bothers me for some while. I will try to explain it - There is some string, whith different letters in it. Is it possible to analyse this string...
4
by: kobe67 | last post by:
Create a program that will ask a string from the user, your program should automatically exchange the 1st & the last letter of every word in the string
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.