function GetTokenIndex(s: string; delimiter: string; index: Integer): string;
function GetShortName(const LongName: string; ALength: integer): string;
+ function TrimThreadTitle(const SrcTitle: string): string;
function BoolToInt(b: Boolean): Integer;
function IntToBool(i: Integer): Boolean;
function GzipDecompress(ResStream: TStream; ContentEncoding: string): string;
ZERO_DATE: Integer = 25569;
BETA_VERSION_NAME_E = 'beta';
BETA_VERSION_NAME_J = 'ÊÞÀ';
- BETA_VERSION = 68;
+ BETA_VERSION = 70;
BETA_VERSION_BUILD = ''; //!< debug\94Å\82È\82Ç
APP_NAME = 'gikoNavi';
BE_PHP_URL = 'http://be.2ch.net/test/p.php?i=';
S : string;
i : integer;
begin
- s := Trim(LongName);
+ s := TrimThreadTitle(Trim(LongName));
if (Length(s) <= ALength) then begin
Result := s;
end else begin
end;
end;
+function TGikoSys.TrimThreadTitle(const SrcTitle: string): string;
+const
+ TRIM_STRING: array [1..4] of String =
+ ('[\93]\8dÚ\8bÖ\8e~]', '©2ch.net', '©bbspink.com', #9);
+var
+ i: Integer;
+ Idx: Integer;
+ Len: Integer;
+ DstTitle: String;
+begin
+ if (Setting.ThreadTitleTrim = True) then begin
+ DstTitle := SrcTitle;
+ for i := Low(TRIM_STRING) to High(TRIM_STRING) do begin
+ Len := Length(TRIM_STRING[i]);
+ while (True) do begin
+ Idx := Pos(TRIM_STRING[i], DstTitle);
+ if (Idx < 1) then
+ Break;
+ Delete(DstTitle, Idx, Len);
+ end;
+ end;
+ Result := Trim(DstTitle);
+ end else begin
+ Result := SrcTitle;
+ end;
+end;
+
{!
\brief Boolean \82ð Integer \82É\95Ï\8a·
\return False..0, True..1