Pascal:将字符串转换为某个字符串

时间:2014-11-19 10:56:03

标签: arrays string char pascal

在pascal中,如何将string-var转换为某些char-var?例如:

var Name:string;
    Arrayname:array[1..10]of char;      
...
Name:='wow';                             { I know that I write no sense things, I invent }
Arrayname[1]:=chr[1]of name;             { this command roght now !                      }
...

1 个答案:

答案 0 :(得分:1)

我找到了方法:

var name:string;
begin
name:='gallo';
write(name[1]);

然后输出为:

g

:)