Core Function BinaryStr

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(binary-array)
m (1 revision)
 
(4 intermediate revisions by one user not shown)
Line 25: Line 25:
 
=== Remarks ===
 
=== Remarks ===
  
A string has a value of zero.
+
N/A
  
 
=== Example ===
 
=== Example ===
  
 
<syntaxhighlight lang="sputnik">
 
<syntaxhighlight lang="sputnik">
$binary = Pack("z0", "Hello World!")
+
$binary = Pack("A*", "Hello World!");
println( "Binary HEX: '" . BinaryStr($binary) . "'" )
+
println( "Binary HEX: '" . BinaryStr($binary) . "'" );
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
Now with , for separation
 
Now with , for separation
 
<syntaxhighlight lang="sputnik">
 
<syntaxhighlight lang="sputnik">
$binary = Pack("z0", "Hello World!")
+
$binary = Pack("A*", "Hello World!");
println( "Binary HEX: '" . BinaryStr($binary, ",") . "'" )
+
println( "Binary HEX: '" . BinaryStr($binary, ",") . "'" );
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
[[Category:Core Function]]
 
[[Category:Core Function]]

Latest revision as of 12:38, 14 June 2015

BinaryStr( <binary-array>, <separator> ) 

Contents

Description

Create a Hex string from a binary array.

Parameters

binary-array

A variable containing a binary array.

separator

A string to place between each element default is a single space.

Return Value

Success: Returns an hex string.

Failure: Returns empty string.

Remarks

N/A

Example

$binary = Pack("A*", "Hello World!");
println( "Binary HEX: '" . BinaryStr($binary) . "'" );

Now with , for separation

$binary = Pack("A*", "Hello World!");
println( "Binary HEX: '" . BinaryStr($binary, ",") . "'" );
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox