小编Yoa*_*n15的帖子

验证一个字符串是否包含在 Lisp 中的另一个字符串中的函数

我正在尝试编写一个函数来验证一个字符串是否包含在 Lisp 中的另一个字符串中,但我不能

例如 :

(string-include 'abd 'abbbe) => nil

(string-include 'ghf 'dghfd) => ghf
Run Code Online (Sandbox Code Playgroud)

这是我的功能:

(defun string-include (string1 string2)
  (cond
    ((not string1) 0)
    ((not string2) 0)
    ((.... (string1) (string2)) (string1 (string-include string1 (cdr string2))))
    ((string-include  string1 (cdr string2)) ) )
Run Code Online (Sandbox Code Playgroud)

lisp string common-lisp

2
推荐指数
1
解决办法
2539
查看次数

标签 统计

common-lisp ×1

lisp ×1

string ×1