how to convert sb.toString() to char type?? who can help me..?
Kath_Fish
0
Junior Poster
Recommended Answers
Jump to PostYou can convert it to a character array by appending .ToCharArray()
Jump to Postsb.ToString().ToCharArray()
Jump to PostSince you have a character array, the first part of your foreach loop has to state Char, not string
foreach(char a in sb.ToString())
There is only one string in a StringBuilder. foreach is for use with collections (IEnumerable) not single values.
All 11 Replies
Momerath
1,327
Nearly a Senior Poster
Featured Poster
Kath_Fish
0
Junior Poster
Momerath
1,327
Nearly a Senior Poster
Featured Poster
Kath_Fish
0
Junior Poster
Momerath
1,327
Nearly a Senior Poster
Featured Poster
Kath_Fish
0
Junior Poster
arjunpk
-6
Light Poster
Kath_Fish
0
Junior Poster
Momerath
1,327
Nearly a Senior Poster
Featured Poster
Mitja Bonca
557
Nearly a Posting Maven
Kath_Fish
0
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.