找到你要的答案

Q:How to compare strings using joker characters (* and ?) in Pascal?

Q:如何利用小丑字符比较字符串(*和?)在PASCAL语言吗?

What i want is when I type in a string, it searches for that in an other string (A+ English I know).

Something like a:='*'+b+'*' has worked once, but I don't remember how I did it.

the code right now is this:

b:='x';
readln(a);

if a=('*'+b+'*') then writeln('ok');
else writeln('not ok');

And it runs just fine, except it always says "not ok", and that wasn't quite what I wanted to make.

我想要的是当我键入一个字符串,它搜索的其他字符串(+英语我知道)。

类似的东西:= * + + + + ' * '已经工作了一次,但我不记得我是怎么做的。

现在的代码就是这样:

b:='x';
readln(a);

if a=('*'+b+'*') then writeln('ok');
else writeln('not ok');

它运行良好,除了它总是说“不确定”,这不是我想做的。

answer1: 回答1:

I found and IsWild function here and it works fine:

http://www.freepascal.org/docs-html/rtl/strutils/iswild.html

我发现,iswild功能在这里很好的工作:

http://www.freepascal.org/docs-html/rtl/strutils/iswild.html

string  wildcard  pascal