‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
string_shared.gsc
Go to the documentation of this file.
1 #insert scripts\shared\shared.gsh;
2 
3 #using scripts\shared\array_shared;
4 
5 #namespace string;
6 
7 /#
8 
9 function ‪rfill( str_input, n_length, str_fill_char = " " )
10 {
11  if ( str_fill_char == "" )
12  {
13  str_fill_char = " ";
14  }
15 
16  Assert( str_fill_char.size == 1, "Fill string can only be 1 character." );
17 
18  str_input = "" + str_input; // convert input to string if not already
19 
20  n_fill_count = n_length - str_input.size;
21 
22  str_fill = "";
23 
24  if ( n_fill_count > 0 )
25  {
26  for ( i = 0; i < n_fill_count; i++ )
27  {
28  str_fill += str_fill_char;
29  }
30  }
31 
32  return ( str_fill + str_input );
33 }
34 
35 #/
‪rfill
‪function rfill(str_input, n_length, str_fill_char=" ")
Definition: string_shared.gsc:9