⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 _ststring.pas

📁 条码控件: 一维条码控件 二维条码控件 PDF417Barcode MaxiCodeBarcode
💻 PAS
📖 第 1 页 / 共 3 页
字号:
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.CopyMidW(S, Cardinal(First), Cardinal(Len));
end;

function TStString.CopyRight(const S: WideString;
  First: Integer): WideString;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.CopyRightW(S, Cardinal(First));
end;

function TStString.CopyWithin(const S, Delimiter: WideString;
  Strip: WordBool): WideString;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.CopyWithinW(S, Delimiter, Strip);
end;

function TStString.DefaultExtension(const Name,
  Ext: WideString): WideString;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.DefaultExtensionW(Name, Ext);
end;

function TStString.DeleteFromNthWord(const S, WordDelims,
  AWord: WideString; N: Integer; var SubString: WideString): WordBool;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.DeleteFromNthWordW(S, WordDelims, AWord, Cardinal(N), SubString);
end;

function TStString.DeleteFromToWord(const S, WordDelims, Word1,
  Word2: WideString; N1, N2: Integer; var SubString: WideString): WordBool;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.DeleteFromToWordW(S, WordDelims, Word1, Word2, Cardinal(N1), Cardinal(N2), SubString);
end;

function TStString.DeleteWithin(const S,
  Delimeter: WideString): WideString;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.DeleteWithinW(S, Delimeter);
end;

function TStString.Detab(const S: WideString; TabSize: Byte): WideString;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.DetabW(S, TabSize);
end;

function TStString.Entab(const S: WideString; TabSize: Byte): WideString;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.EntabW(S, TabSize);
end;

function TStString.Ext2Str(R: OleVariant; Width, Places: Byte): WideString;
var
  X : Extended;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  {!! Will this work with an OleVariant instead of Extended? !!}
  X := R;
  Result := StStrW.Ext2StrW(X, Width, ShortInt(Places));
end;

function TStString.ExtractAscii(N: Integer; const S, WordDelims,
  Quote: WideString): WideString;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.ExtractAsciiW(Cardinal(N), S, WordDelims, Quote[1]);
end;

function TStString.ExtractTokens(const S, Delims, QuoteChar: WideString;
  AllowNulls: WordBool; out Tokens: IStStringList): Integer;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  FTokensList.Clear;
  Result := StStrW.ExtractTokensW(S, Delims, QuoteChar[1], AllowNulls, FTokensList);
  Tokens := FTokens;
end;

function TStString.ExtractWord(N: Integer; const S,
  WordDelims: WideString): WideString;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.ExtractWordW(Cardinal(N), S, WordDelims);
end;

function TStString.Filter(const S, Filters: WideString): WideString;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.FilterW(S, Filters);
end;

function TStString.FloatForm(const Mask: WideString; R: Double; L: Integer;
  const LtCurr, RtCurr, Sep, DecPt: WideString): WideString;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.FloatFormW(Mask, R, LtCurr, RtCurr, Sep[1], DecPt[1])
end;

function TStString.ForceExtension(const Name, Ext: WideString): WideString;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.ForceExtensionW(Name, Ext);
end;

function TStString.HasExtension(const Name: WideString;
  var DotPos: Integer): WordBool;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.HasExtensionW(Name, Cardinal(DotPos));
end;

function TStString.HexB(B: Byte): WideString;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.HexBW(B);
end;

function TStString.HexW(W: Integer): WideString;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.HexWW(W);
end;

function TStString.HexL(L: Integer): WideString;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.HexLW(LongInt(L));
end;

function TStString.IsChAlpha(const C: WideString): WordBool;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.IsChAlphaW(C[1]);
end;

function TStString.IsChAlphaNumeric(const C,
  Numbers: WideString): WordBool;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.IsChAlphaNumericW(C[1], Numbers);
end;

function TStString.IsChNumeric(const C, Numbers: WideString): WordBool;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.IsChNumericW(C[1], Numbers);
end;

function TStString.IsStrAlpha(const S: WideString): WordBool;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.IsStrAlphaW(S);
end;

function TStString.IsStrAlphaNumeric(const S,
  Numbers: WideString): WordBool;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.IsStrAlphaNumericW(S, Numbers);
end;

function TStString.IsStrNumeric(const S, Numbers: WideString): WordBool;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.IsStrNumericW(S, Numbers);
end;

function TStString.JustExtension(const Name: WideString): WideString;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.JustExtensionW(Name);
end;

function TStString.JustFilename(const PathName: WideString): WideString;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.JustFilenameW(PathName);
end;

function TStString.JustName(const PathName: WideString): WideString;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.JustNameW(PathName);
end;

function TStString.JustPathname(const PathName: WideString): WideString;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.JustPathnameW(PathName);
end;

function TStString.KeepChars(const S, Chars: WideString): WideString;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.KeepCharsW(S, Chars);
end;

function TStString.LastString(const S, AString: WideString;
  var Position: Integer): WordBool;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.LastStringW(S, AString, Cardinal(Position));
end;

function TStString.LastWord(const S, WordDelims, AWord: WideString;
  var Position: Integer): WordBool;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.LastWordW(S, WordDelims, AWord, Cardinal(Position));
end;

function TStString.LastWordAbs(const S, WordDelims: WideString;
  var Position: Integer): WordBool;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.LastWordAbsW(S, WordDelims, Cardinal(Position));
end;

function TStString.LeftPad(const S: WideString; Len: Integer): WideString;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.LeftPadW(S, Cardinal(Len));
end;

function TStString.LeftPadCh(const S, C: WideString;
  Len: Integer): WideString;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.LeftPadChW(S, C[1], Cardinal(Len));
end;

function TStString.LeftTrimChars(const S, Chars: WideString): WideString;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.LeftTrimCharsW(S, Chars);
end;

function TStString.Long2Str(L: Integer): WideString;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.Long2StrW(LongInt(L));
end;

function TStString.LongIntForm(const Mask: WideString; L: Integer;
  const LtCurr, RtCurr, Sep: WideString): WideString;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.LongIntFormW(Mask, LongInt(L), LtCurr, RtCurr, Sep[1]);
end;

function TStString.OctalB(B: Byte): WideString;
begin
  {$IFDEF LICENSE}
   if (not FIsLicensed) or (not COMHasBeenLicensed) then
     OleError(CLASS_E_NOTLICENSED);
  {$ENDIF}
  Result := StStrW.OctalBW(B);
end;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -