由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - c# question: char_array.ToString() is not working ?
相关主题
Array in C问个程序问题
new了指针,delete的时候出错了map析构
两个继承问题address of an array
几个C++书写风格疑问怎么判断int a[]的array的实际长度?
一道Microsoft的面试题谁给解释一下这个c question
这段code有啥问题?array和pointer在作为函数返回时有啥区别 (C)
请教c++ interface class问题问一个 char * 和 char [] 的问题
How to call python_function(class param, char *buf) from c++问个指针array 的简单问题
相关话题的讨论汇总
话题: array话题: char话题: tostring话题: mystr话题: c#
进入Programming版参与讨论
1 (共1页)
s*****w
发帖数: 1527
1
hi, i have a char array like this,
char array[0]='a', array[1]='b', array[2]='c';
string myStr = array.ToString();
myStr is not "abc", why ?
h*******s
发帖数: 8454
2
不懂c#不过可以考虑把array[3]弄成\0试试看?

【在 s*****w 的大作中提到】
: hi, i have a char array like this,
: char array[0]='a', array[1]='b', array[2]='c';
: string myStr = array.ToString();
: myStr is not "abc", why ?

c**t
发帖数: 2744
3
you need implement ToString()

【在 s*****w 的大作中提到】
: hi, i have a char array like this,
: char array[0]='a', array[1]='b', array[2]='c';
: string myStr = array.ToString();
: myStr is not "abc", why ?

s*****w
发帖数: 1527
4
hmmmm, never know that ...

【在 c**t 的大作中提到】
: you need implement ToString()
j*****u
发帖数: 1133
5
use the string ctor that takes char array as param:
http://msdn.microsoft.com/en-us/library/ttyxaek9(v=VS.90).aspx

【在 s*****w 的大作中提到】
: hi, i have a char array like this,
: char array[0]='a', array[1]='b', array[2]='c';
: string myStr = array.ToString();
: myStr is not "abc", why ?

s*****w
发帖数: 1527
6
did that, but still don't like it.
in my case, i need to
1. left shift the string
2. put the new char in the right most string position
e.g.
"i love my family" => "i love my family."
so what's the best way ?

【在 j*****u 的大作中提到】
: use the string ctor that takes char array as param:
: http://msdn.microsoft.com/en-us/library/ttyxaek9(v=VS.90).aspx

s***o
发帖数: 2191
7
do you have to use Array?
With a derived List type, you can override the ToString() method and
output whatever you like.

【在 s*****w 的大作中提到】
: did that, but still don't like it.
: in my case, i need to
: 1. left shift the string
: 2. put the new char in the right most string position
: e.g.
: "i love my family" => "i love my family."
: so what's the best way ?

1 (共1页)
进入Programming版参与讨论
相关主题
问个指针array 的简单问题一道Microsoft的面试题
关于二维矩阵的C的问题这段code有啥问题?
override operator[] inline请教c++ interface class问题
Spring REST+AFNetworking问题How to call python_function(class param, char *buf) from c++
Array in C问个程序问题
new了指针,delete的时候出错了map析构
两个继承问题address of an array
几个C++书写风格疑问怎么判断int a[]的array的实际长度?
相关话题的讨论汇总
话题: array话题: char话题: tostring话题: mystr话题: c#