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

Remove the last character

Hi,

I use a combobox to get a list of fruits (_SelectedIndexChanged)... I
manage to get

Apple, Orange, Grape,

The question: How to get rid of the last comma (Grape
,
<--)

thanks.

Jul 21 '05 #1
3 1428
Hi Blackdevil
In a string when you are sure the lastcharacter is the lastcomma

mytext = combobox.text.substring(0, combobox.substring.text.length-2)

When you do not know it
first
if combobox.text.lenght-2 = "," etc

I hope this helps?

Cor
Jul 21 '05 #2
you could use
..TrimEnd(",".ToCharArray()

José

"blackdevil1979" <bl************@yahoo-dot-com.no-spam.invalid> wrote in
message news:41********@Usenet.com...
Hi,

I use a combobox to get a list of fruits (_SelectedIndexChanged)... I
manage to get

Apple, Orange, Grape,

The question: How to get rid of the last comma (Grape
,
<--)

thanks.

Jul 21 '05 #3
Thank you.. :) It's working fine now

Jul 21 '05 #4

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

Similar topics

5
by: Donald Canton | last post by:
What's the best way to remove trailing whitespace from a string? For example: "John C. Doe \t" would become "John C. Doe". Thanks.
4
by: frank | last post by:
How do I remove the furthest right (last) character in a string in C#?
18
by: Toto | last post by:
Hello, my problem is quite simple to explain. I have the following string: "table+camera" and I want to remove the + sign: "tablecamera". How do i do that ?
9
by: yawnmoth | last post by:
Say I have the following file - dummy.txt: a 4treg a sdfas a 4egdsag b 1111 a ergdsfg b 1111 c waefasdf
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
100
by: jacob navia | last post by:
Recently, a heated debate started because of poor mr heathfield was unable to compile a program with // comments. Here is a utility for him, so that he can (at last) compile my programs :-) ...
9
by: ice | last post by:
Hello, I have a couple of tables. The client tables and the contacted tables. I am not sure how to start on this, what I need is a way to query all my clients then show any client that the...
3
by: rsennat | last post by:
hi, how do I remove the last character in a string only if its a "/". otherwise no need to remove the last character. im using std::string. tried with find_last_of( ). thanks rsennat
10
by: Mike Copeland | last post by:
I have data I need to normalize - it's "name" data. For example, I have the following: "Watts, J.C." I wish to (1) parse the "first name" ("J.C.") and adjust it to "JC". Essentially, I want to...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.