Link to home
Start Free TrialLog in
Avatar of arint
arint

asked on

string to Char coonversion

is there any way to convert "D" as a string type into "D" as a char type with Delphi 3?
Avatar of arint
arint

ASKER

Edited text of question
What about ?

var
  St : String;
  Ch : PChar;
begin
  Ch := PChar(St);
  ...
end;

itamar's answer will convert string to PChar.  If you want to convert string to Char, try this:

var
  c: PChar;
  s: string;
begin
  c := ' ';
  if (Length(s) > 0) then
    c := @s[1];
  ...
end;

JB
P.S.  Should read
    c := s[1];
NOT
    c := @s[1];

JB
ASKER CERTIFIED SOLUTION
Avatar of aluiken
aluiken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
HEI !

Isn't this "proposed answer" the JimBob's comment put as an answer ?? :<
yeah but if you leave the question open it's easy point's !!
You clearly have a good idea of the spirit in which Experts Exchange is run...