在调用解密命令之前,清单13中的字符串操作函数将替换丢失的格式。
The string manipulation functions in Listing 13 replace the lost formatting before the decryption command is called.
无论您将哪种数据格式传入这些函数,它们将始终返回字符串。
No matter what data format you put into these functions, they will always return a string.
您可能会感到奇怪。其实内部函数调用将输入字符串转换成使用特定格式编译的时间戳。
In case you're curious, the inner function call converts the input string into a timestamp that complies with a specific format.
这类函数始终需要调用者为其提供一个字符串来进行格式化,因此应当使用命名参数。
Such a function would always require the caller to supply the string to be formatted, so that parameter should be explicitly named.
我最喜欢的方式是使用配置文件并在配置文件中定义一个常量,这个常量保留date函数的格式字符串。
My favorite is to use a configuration file and define a constant in it that holds the format string for the date function.
语言环境设置会导致printf中的%l s格式说明符调用wcsrtombs函数以便于将宽字符的参数字符串转换成依赖语言环境的多字节编码。
The locale setting will cause the % ls format specifier in printf to call the wcsrtombs function in order to convert the wide character argument string into the locale-dependent multi-byte encoding.
例如,假设您希望创建一个CommentBlock函数,它将接收一个字符串并针对不同的编程语言将其格式化为相应的注释块。
For example, suppose you wanted to create a CommentBlock function that was passed a string and formatted it into an appropriate comment block for various programming languages.
此函数使用的格式字符串在很多地方都有描述(如PHP.net中),故在此不再赘述。
The formatting strings used for this function are described in many places, such as PHP.net, so I won't reiterate them here.
Render —返回HTML字符串的函数,这些字符串根据我们显示每个服务器条目的规则进行格式化。
Render — Function that returns an HTML string, formatted according to some rules we devise on how we prefer each server entry to be displayed.
sprintf函数使用一个控制字符串来指定输出格式,该控制字符串通常包括“%s”(字符串输出)。
The sprintf function USES a control string to specify the output format, and often the control string includes "% s" (string output).
上一篇文章最后给出了一个名为 convert_to_upper 的函数,它一次操作一个字节,并将字符串转换成大写格式。
The last article ended with a function called convert_to_upper, which operated one byte at a time to convert a string to uppercase.
D {format}:括弧里的字符串被传递给strftime(3)函数,返回值填充到提示符中。如果不传参数,会按照系统默认的当地时间格式来显示。
D {format} : the format is passed to strftime (3) and the result is inserted into the prompt string; an empty format results in a locale-specific time representation.
D {string}- string字符串是strftime函数的格式化参数。
D {string} - string is formatted using the strftime function.
函数随带一个格式化字符串和一个可变数目的参数。
The function takes a format string and a variable number of arguments.
函数的作用是:输出格式化字符串到流(例如:文件或数据库)。
The vfprintf() function writes a formatted string to a specified output stream (example: file or database).
函数的作用是:输出格式化字符串到流(例如:文件或数据库)。
The vfprintf() function writes a formatted string to a specified output stream (example: file or database).
应用推荐