base/utils/strings.bro
Functions to assist with small string analysis and manipulation that can
be implemented as Bro functions and don’t need to be implemented as built-in
functions.
Detailed Interface
Functions
-
cut_tail
-
Cut a number of characters from the end of the given string.
S: | a string to trim. |
Tail_len: | the number of characters to remove from the end of the string. |
Returns: | the given string with tail_len characters removed from the end. |
-
is_string_binary
-
Returns true if the given string is at least 25% composed of 8-bit
characters.
-
join_string_set
-
Join a set of strings together, with elements delimited by a constant string.
Ss: | a set of strings to join. |
J: | the string used to join set elements. |
Returns: | a string composed of all elements of the set, delimited by the
joining string. |
-
string_escape
-
Given a string, returns an escaped version.
S: | a string to escape. |
Chars: | a string containing all the characters that need to be escaped. |
Returns: | a string with all occurrences of any character in chars escaped
using \ , and any literal \ characters likewise escaped. |