Change character in Tedit Delphi

感情迁移 提交于 2019-12-11 08:28:35

问题


Sorry for my bad english. How to block a character in TEdit if I have text 'Kamu' in first TEdit and 'Dia' in 2nd TEdit where character is 'a' and change them to 'i' in 3rd TEdit?


回答1:


Use StringReplace.

NewValue := StringReplace(OldValue, 'a', 'i', [rfReplaceAll, rfIgnoreCase]);

You may want to omit rfIgnoreCase depending on your needs. You can read from and write to the content of the TEdit control by using its Text property. For instance:

Edit1.Text := StringReplace(Edit1.Text, ...);


来源:https://stackoverflow.com/questions/28961459/change-character-in-tedit-delphi

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!