title: Minecraft spigot plugin, multiple args to string
body: <p>I'm trying to make plugin where player can change sign with command <code>/signeditor2 edit &lt;Line-number&gt; &lt;text that can have spaces&gt;</code>
  But I just can't figure out how to do it.
  This is my code but when i use it it only type on the sign first word of the message.
  How can I connect all args after the Line number to one string and then put the string to the sign?</p>
  <pre><code>public class SignEditor implements CommandExecutor {
  
      
      public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
          int al = args.length;
          if (label.equalsIgnoreCase(&quot;SignEditor&quot;)) {
              if (args[0].equalsIgnoreCase(&quot;Edit&quot;)){
                  // player
                  Player player = (Player) sender;
                  String Sarg1 = args[1];
                  int arg1 = Integer.parseInt(Sarg1);
                  Block b = player.getTargetBlock(null, 10);
                  
                  if (sender instanceof Player) {
                      if (player.hasPermission(&quot;dg.SignEditor.edit.use&quot;)) {
                          if (args.length &gt; 0 ) {
                              if (b.getType().name().contains(&quot;SIGN&quot;)) {
                                  if ((arg1 - 1) &gt; 3 || (arg1 -1 &lt; 0)) {
                                      player.sendMessage(ChatColor.translateAlternateColorCodes('&amp;', &quot;&amp;7&lt;&amp;6SignEditor&amp;7&gt; &quot; + Main.plugin.getConfig().getString(&quot;Edit.Failed.InvalidLine&quot;)));      
                                  }
                                  else {
                                      StringBuilder sb = new StringBuilder(args[2]);
                                      for (int i = 2; i &lt; al; i++) {
                                          sb.append(' ').append(args[i]);
                                      }
                                      String sbs = sb.toString();
                                      Block bx = player.getTargetBlockExact(10);
                                      Sign sign = (Sign) bx.getState();
                                      sign.setLine(arg1 - 1, sbs);
                                      sign.update();
                                      player.sendMessage(ChatColor.translateAlternateColorCodes('&amp;', &quot;&amp;7&lt;&amp;6SignEditor&amp;7&gt; &quot; + Main.plugin.getConfig().getString(&quot;Edit.Succsessfull&quot;)));
                                  }
                              }
                              else player.sendMessage(ChatColor.translateAlternateColorCodes('&amp;', &quot;&amp;7&lt;&amp;6SignEditor&amp;7&gt; &quot; + Main.plugin.getConfig().getString(&quot;Edit.Failed.NoSign&quot;)));
                                  return false;
                              }
                                  
                          if (args.length &lt;= 0) {
                              player.sendMessage(ChatColor.translateAlternateColorCodes('&amp;', &quot;&amp;7&lt;&amp;6SignEditor&amp;7&gt; &quot; + Main.plugin.getConfig().getString(&quot;Edit.Failed.NoArguments&quot;)));
                              return false;
                          }
  
                      }
                      player.sendMessage(ChatColor.translateAlternateColorCodes('&amp;', &quot;&amp;7&lt;&amp;6SignEditor&amp;7&gt; &quot; + Main.plugin.getConfig().getString(&quot;Edit.Failed.MissingPermissions&quot;)));
                      return true;
                  }
                  else
                      sender.sendMessage(ChatColor.translateAlternateColorCodes('&amp;', &quot;&amp;7&lt;&amp;6SignEditor&amp;7&gt; &quot; + Main.plugin.getConfig().getString(&quot;Edit.Failed.OnlyPlayers&quot;)));
                      
                  
                  return false;
              }
              if (args[0].equalsIgnoreCase(&quot;reload&quot;)) {
                  Main.plugin.reloadConfig();
                  Player player = (Player) sender;
                  player.sendMessage(ChatColor.translateAlternateColorCodes('&amp;', &quot;&amp;7&lt;&amp;6SignEditor&amp;7&gt; &quot; + Main.plugin.getConfig().getString(&quot;reload.message&quot;)));
              }
          }
          return false;
      }
      public boolean isNum(String num) {
          try {
              Integer.parseInt(num);
          } catch (Exception e) {
              return false;
          }
          return true;
      }
  }
  </code></pre>