How to delete last char

后端 未结 5 1190
醉酒成梦
醉酒成梦 2021-01-12 15:24

How to delete last character of String with substring or anything ?

For example;

var
  query : String;
begin
  query:= \'test=1&line         


        
5条回答
  •  礼貌的吻别
    2021-01-12 16:04

    var
    test: System.String;
    begin
      test := 'Sample Text To Delete Last Character;!';
      test := Copy(test,1,length(test)-1);
      ShowMessage(test);
    end;
    

    Variable is Established;
    A SampleText is provided to the Variable;
    Variable then Reference itself in the Copy command which
    the Copy command takes the variable string by coping it by its length from index 1(length)-1
    which return the result to the variable itself;
    A Message is used to show the result;

    the result would be the text without exclamation; // Sample Text To Delete Last Character;

提交回复
热议问题