Recent

Author Topic: UTF8Keypress event  (Read 2843 times)

ajosifoski

  • Jr. Member
  • **
  • Posts: 55
UTF8Keypress event
« on: August 07, 2012, 03:26:21 pm »
Hi to All

Let say that I have one string with utf8 characters like
st:='љњрјсалкфењоирslfjlsdlksafj';

How can I use UTF8Keypress event to receive one character from keyboard and to make search in string st is character there, and if it is to replace it with some other character, to make new string

Tnx

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: UTF8Keypress event
« Reply #1 on: August 07, 2012, 03:48:38 pm »
Code: [Select]
var
  st :string;
begin
  st := 'áéí';
  if UTF8Key = 'ã' then
    st := StringReplace(st, 'á', 'ã', [rfReplaceAll]);
  ShowMessage(st);
end;
« Last Edit: August 07, 2012, 04:05:56 pm by typo »

 

TinyPortal © 2005-2018