将字符串拆分为字符 [英] Split string into characters
本文介绍了将字符串拆分为字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将字符串拆分为数组中的字符,颠倒字符的顺序,然后再次显示字符串中颠倒的字符.
我很高兴如何拆分字符串并反转字符的顺序,但是如何再次将字符显示为字符串?
感谢您的帮助.
How would you split a string into characters in an array, reverse the order of the characters then display the reversed characters in a string again.
Im happy on how to split the string up and to reverse the order of the characters, but how do i display the chars as a string again?
Thanks for the help guys.
推荐答案
hi
string yourString = "blablabla";
char[] array = yourString.ToCharArray();
Array.Reverse(array);
string yourStringReverse = array.ToString(); //[thanks for the note ProEnggSoft]
string yourStringReverse = String.Join("",array);
请参阅参考资料
http://msdn.microsoft.com/en-us/library/system.string. split.aspx [^ ]
http://msdn.microsoft.com/en-us/library/b873y76a.aspx [ ^ ]
see reference
http://msdn.microsoft.com/en-us/library/system.string.split.aspx[^]
http://msdn.microsoft.com/en-us/library/b873y76a.aspx[^]
请参阅以下内容进行拆分:
http://bytes.com/topic/net/answer/720122-how-c-split-string-each-char-into-array [
Refer this to split:
http://bytes.com/topic/net/answers/720122-how-c-split-string-each-char-into-array[^]
这篇关于将字符串拆分为字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文