title: How to convert YAML list to a string array in Java?
body: <p>I have a YAML configuration file have the below list:</p>
  
  <pre><code>name:
    - string1
    - string2
    - string3
  </code></pre>
  
  <p>I am reading the configuration file as follows:</p>
  
  <pre><code>Yaml = _yml = new Yaml();
  InputStream in = Resources.getResources("myconfigfile.yml").opendStream();
  
  Map cfg_map = (Map) yaml.load(in);
  in.close();
  
  String[] values = cfg_map.get("name");
  </code></pre>
  
  <p>Here in this line <code>String[] values = cfg_map.get("name");</code> gives me the object. How can I convert it to the String array? </p>
  
  <p>I tried with <code>cfg_map.get("name").toString().split("\n")</code> but it didn't work.</p>