mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 14:08:20 +00:00
parent
6b0552fa4f
commit
9a88dc500a
5 changed files with 44 additions and 1 deletions
|
@ -1122,3 +1122,16 @@ function hexdump%(data_str: string%) : string
|
|||
|
||||
return result;
|
||||
%}
|
||||
|
||||
## Returns a reversed copy of the string
|
||||
##
|
||||
## str: The string to reverse.
|
||||
##
|
||||
## Returns: A reversed copy of *str*
|
||||
##
|
||||
function reverse%(str: string%) : string
|
||||
%{
|
||||
string s = string((const char*)str->Bytes(), str->Len());
|
||||
reverse(s.begin(), s.end());
|
||||
return new StringVal(s.length(), (const char*)s.c_str());
|
||||
%}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue