📄 strsep.3
字号:
.\".\" Copyright (c) 1999,2000 WU-FTPD Development Group. .\" All rights reserved..\" .\" Portions Copyright (c) 1980, 1985, 1988, 1989, 1990, 1991, 1993, 1994 .\" The Regents of the University of California. Portions Copyright (c) .\" 1993, 1994 Washington University in Saint Louis. Portions Copyright .\" (c) 1996, 1998 Berkeley Software Design, Inc. Portions Copyright (c) .\" 1998 Sendmail, Inc. Portions Copyright (c) 1983, 1995, 1996, 1997 Eric .\" P. Allman. Portions Copyright (c) 1989 Massachusetts Institute of .\" Technology. Portions Copyright (c) 1997 Stan Barber. Portions .\" Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997 Free Software .\" Foundation, Inc. Portions Copyright (c) 1997 Kent Landfield. .\".\" Use and distribution of this software and its source code are governed .\" by the terms and conditions of the WU-FTPD Software License ("LICENSE"). .\".\" $Id: strsep.3,v 1.4 2000/07/01 18:40:49 wuftpd Exp $.\".TH STRSEP 3 "May 15, 1990".UC 7.SH NAMEstrsep \- separate strings.SH SYNOPSIS.nf.ft B#include <string.h>char *strsep(char **stringp, char *delim);.ft R.fi.SH DESCRIPTION.B Strseplocates in the null-terminated string at.I *stringpthe first occurence of any character in.I delimand replaces this with a '\e0',records the location of the immediate following character in.IR *stringp ,then returns the original value of.IR *stringp .If no delimiter characters are found,.B strsepsets.I *stringpto NULL;if.I *stringpis initially NULL,.B strsepreturns NULL..SH EXAMPLESThe following uses.I strsepto parse strings containing runs of white space,making up an argument vector:.sp.nf.RSchar inputstring[100];char **argv[51], **ap = argv, *p, *val;.I "/* set up inputstring */"for (p = inputstring; p != NULL; ) { while ((val = strsep(&p, " \et")) != NULL && *val == '\e0'); *ap++ = val;}*ap = 0;.RE
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -