473,406 Members | 2,956 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.

+how to C# split string (each char) into array

14
Hello,
Can anyone help me?

I am trying to split a string in c# but i don't have a separator.

for example split the string "hello"
into array [0]=h [1]=e [2]=l [3]=l [4]=o
Oct 8 '07 #1
2 21761
Plater
7,872 Expert 4TB
Try this:
Expand|Select|Wrap|Line Numbers
  1. string mys="hello";
  2. char[] thechars=mys.ToCharArray();
  3.  
Oct 8 '07 #2
Kate77
14
Try this:
Expand|Select|Wrap|Line Numbers
  1. string mys="hello";
  2. char[] thechars=mys.ToCharArray();
  3.  
Thanks!!!! it works.
cheers.
Oct 8 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: AlexFarokhyans | last post by:
Hello, I'm trying to convert String to Char array. I'm getting a string from user input text box and then I have char firstName. I need to convert the string that is in the text box to firstName....
2
by: ad | last post by:
I have a string vaiable like "1a3345"; How to separate the string into a char array or a string array just have on character per element?
1
by: joye | last post by:
Hello, How to convert an unmanaged string with char array type to a managed string with char array type? Thanks. Regards, Tsung-Yu
0
by: joye | last post by:
Hello , I meet some data convertion problem, the sample code as following, namespace Configure { using namespace System ; typedef struct _SW{ char szVersion ;
1
by: joye | last post by:
Hello , I meet some data convertion problem, the sample code as following, namespace Configure { using namespace System ; typedef struct _SW{ char szVersion ;
4
by: Ori :) | last post by:
Hi guys I have a 50 charecters long string and I need to examine every charectar individually, I thought of converting the string into and Char array of 50 and then go over the array, how can I...
3
by: David | last post by:
Hi, how to convert a char array(byte) to a string variable? byte buffer; string strTest; /*the blow codes all get type of 'buffer': System.Byte! strTest = buffer.ToString() strTest =...
7
by: Felix85 | last post by:
I am trying to make a command interpreter for a mud that i am working on the problem i am having right now is that i cannot convert the string into a char array. This is the error I am getting...
7
by: Neo | last post by:
Hi, I have a programs that reads char ouput and should send a signal when it reads "login". I am currently reading into a char array but how do I check for the match? I don't think I can do- char...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
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
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...

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.