"Sputnik" help  
Sputnik Help
BinaryTrimRight(<binary>, <trimBinary>

Description

Removes trailing occurrences of the specified binary string from the given binary string. If the optional second parameter is not provided, the function trims the default whitespace characters (0x20, 0x09, 0x0D, 0x0A). The function returns the resulting trimmed binary string.

Parameters

<binary> The input binary string to be trimmed.
<trimBinary> Optional binary string to be trimmed. If not provided, it defaults to whitespace characters (0x20, 0x09, 0x0D, 0x0A).

Return Value

Success: Returns trimmed binary string.
Failure: Returns empty binary string.

Remarks

The BinaryTrimRight function trims trailing occurrences of the specified trim binary string from the input binary string. If no trim string is provided, the function trims the default whitespace characters (0x20, 0x09, 0x0D, 0x0A). This function is useful for removing unwanted suffixes or trailing delimiters from binary data, ensuring the data is concise and aligned with the desired format. The resulting trimmed binary string is returned, facilitating efficient data processing and manipulation tasks.

Related

BinaryTrim, BinaryTrimStart, BinaryTrimEnd, BinaryTrimLeft

Example

Trim Binary:

my $a = bin("      Hello      ");
my $b = BinaryTrimRight($a);
say "\"$a\"";
say "\"$b\"";
// PRINTS
// "      Hello      "
// "      Hello"

 


Contact
Cheryl (uberfox@hotmail.com)
Homepage
http://ubersoft.org