You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: get_method_id.m
    path of file: ./repos/lrslibrary
    
    the code of the file until where you have to start completion: %% int get_method_id(string)
% method - string
% id - int
function [method_id] = get_method_id(method)
  if(length(method) > 1)
    method_split = strspl
    
function [method_id] = get_method_id(method)
  if(length(method) > 1)
    method_split = strsplit(method,'-');
    method_id = strtrim(method_split(1));
    method_id = char(method_id);
  else
    method_id = 0;
  end