簡體   English   中英

emacs lisp中的strstr()?

[英]strstr() in emacs lisp?

我想在另一個中搜索一個字符串(基本上是在C strstr做的),而我在elisp手冊中找不到任何內容。

我是否必須重新實現所有這些,或者我錯過了一些明顯的東西?

字符串是序列。 因此搜索工作將:

(search "foo" "in foo-bar")
3

或者你可以使用正則表達式:

(string-match-p "foo" "barfoo")
3

要么

(string-match "foo" "barbar")
nil

有關詳細信息,請參閱Regexp-Search

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM