pike.git
/
src
/
builtin.cmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/builtin.cmod:1:
/* -*- c -*- || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information.
-
|| $Id: builtin.cmod,v 1.
244
2010/01/02
17
:
12
:
41
srb Exp $
+
|| $Id: builtin.cmod,v 1.
245
2010/01/02
18
:
21
:
19
srb Exp $
*/ #include "global.h" #include "interpret.h" #include "svalue.h" #include "pike_macros.h" #include "object.h" #include "program.h" #include "array.h" #include "pike_error.h"
pike.git/src/builtin.cmod:746:
case 1: DO_IT (p_wchar1); break; case 2: DO_IT (p_wchar2); break; #undef DO_IT } RETURN string_slice (s, start, end + 1 - start); } /*! @decl string normalize_space (string s, string|void whitespace) *! @belongs String *!
-
*!
Returns
@[
s
]
with
white space normalised.
+
*!
@param
s
+
*!
Is returned after
white space
in it has been
normalised.
*! White space is normalised by stripping leading and trailing white space *! and replacing sequences of white space characters with a single space.
-
*! @[whitespace] is defined to be " \t\r\n\v\f" if omitted, the first
-
*! character denotes the replacement character for replacing sequences.
+
*!
-
*!
Note
that
trailing
and leading whitespace around \r and \n characters
-
*! is stripped as well.
+
*!
@param
whitespace
+
*!
Defines what is considered to be white space eligible for normalisation.
+
*! It has a default value of @expr{" \t\r\n\v\f"@}.
+
*! The first character denotes the character for replacing sequences.
+
*!
+
*! @note
+
*! Trailing
and leading whitespace around \r and \n characters
+
*! is stripped as well
(only useful if they're not in the @[whitespace] set)
.
*/ PMOD_EXPORT PIKEFUN string string_normalize_space (string s, string|void whitespace) errname String.normalize_space; optflags OPT_TRY_OPTIMIZE; { size_t len = s->len; void *src = s->str; unsigned shift = s->size_shift; const char *ws; struct string_builder sb;