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

String Separator

Can anybody help with this , I have a String like"ABCDE", I wanted to
convert this into string array String array[]={"A","B","C","D","E"}. I
know we have to use string.Split(). But not sure how to send the
Delimiter.

Thanks
K

Sep 27 '06 #1
4 5955
You should not use Split() method. Try ToCharArray and call ToString on each
char in the array returned instead.

"kvicky" <ka**************@gmail.comwrote in message
news:11**********************@d34g2000cwd.googlegr oups.com...
Can anybody help with this , I have a String like"ABCDE", I wanted to
convert this into string array String array[]={"A","B","C","D","E"}. I
know we have to use string.Split(). But not sure how to send the
Delimiter.

Thanks
K

Sep 27 '06 #2

Lebesgue wrote:
You should not use Split() method. Try ToCharArray and call ToString on each
char in the array returned instead.

"kvicky" <ka**************@gmail.comwrote in message
news:11**********************@d34g2000cwd.googlegr oups.com...
Can anybody help with this , I have a String like"ABCDE", I wanted to
convert this into string array String array[]={"A","B","C","D","E"}. I
know we have to use string.Split(). But not sure how to send the
Delimiter.

Thanks
K
Thank you so much...it worked!!!

K

Sep 27 '06 #3
KH
You could call Split() with empty string as the delimiter. Less work than
converting to chars and back to strings, assuming the chars need to be
changed back to strings.
"Lebesgue" wrote:
You should not use Split() method. Try ToCharArray and call ToString on each
char in the array returned instead.

"kvicky" <ka**************@gmail.comwrote in message
news:11**********************@d34g2000cwd.googlegr oups.com...
Can anybody help with this , I have a String like"ABCDE", I wanted to
convert this into string array String array[]={"A","B","C","D","E"}. I
know we have to use string.Split(). But not sure how to send the
Delimiter.

Thanks
K


Sep 27 '06 #4
Thanks for pointing this out. I thought this could work but couldn't check
at the time I was replying to the original question.

"KH" <KH@discussions.microsoft.comwrote in message
news:14**********************************@microsof t.com...
You could call Split() with empty string as the delimiter. Less work than
converting to chars and back to strings, assuming the chars need to be
changed back to strings.
"Lebesgue" wrote:
>You should not use Split() method. Try ToCharArray and call ToString on
each
char in the array returned instead.

"kvicky" <ka**************@gmail.comwrote in message
news:11**********************@d34g2000cwd.googleg roups.com...
Can anybody help with this , I have a String like"ABCDE", I wanted to
convert this into string array String array[]={"A","B","C","D","E"}. I
know we have to use string.Split(). But not sure how to send the
Delimiter.

Thanks
K



Sep 28 '06 #5

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

Similar topics

3
by: Cavello | last post by:
Hi, I'm curious as to how I can input a string of characters and then output it in sections, seperating these sections according to a particular value entered, for example a period. Say if I enter...
10
by: Christopher Benson-Manica | last post by:
(if this is a FAQ, I apologize for not finding it) I have a C-style string that I'd like to cleanly separate into tokens (based on the '.' character) and then convert those tokens to unsigned...
4
by: blrmaani | last post by:
Here is what I want: string s1 = "This is a list of string"; list<string> s2 = s1.some_method(); Now, I should be able to traverse list s2 and get each member ( which is of type 'string' ). ...
3
by: tvn007 | last post by:
Please help, I am not sure why this code not even compile due to line 39 and 44. Thanks in advance for any help 1 #include <cctype> 2 #include <iostream> 3 #include <string> 4 #include...
7
by: ShadowOfTheBeast | last post by:
hi, i know this might sound absurd but does anyone know how to search fora particular pattern of text within a string and remove that every text from the beginning of the string to that...
2
by: James | last post by:
Hi, I am looking for a stringtokenizer class/method in C#, but can't find one. The similar classes in Java and C++ are StringTokenizer and CStringT::tokenize respectively. I need to keep a...
5
by: ikshefem | last post by:
I often need to re-code for myself a small code snippet to define string.upto() and string.from(), which are used like : # canonical examples > "1234456789".upto("45") '1234' >...
25
by: John Salerno | last post by:
Forgive my excitement, especially if you are already aware of this, but this seems like the kind of feature that is easily overlooked (yet could be very useful): Both 8-bit and Unicode strings...
10
by: vunet.us | last post by:
Hello, I use XMLHTTP to get an HTML of another page. Then, I need to cut some middle part of that HTML string but I have problems doing it (see note in caps below). The error I have generated at...
9
by: gs | last post by:
is there any built in function or dotnet framework(version 2) to merge a generic list of string into one string with each element delimited by specified delimiting string? or do I have to roll...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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...
0
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...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.