Type 'String' Is Not A Subtype Of Type 'List
I've got the following code which works well if there are tags present in the
List<String> split = widget.tagname?.split(',')??'';
However, if there are no tags in the list I get this error;
type 'String' is not a subtype of type 'List<String>'
What am I doing wrong?
null, then the compiler attempts to assign the value
'' to a
List<String>, which is not possible. Replace
 and you should be fine.
- → I can't convert Json to string [OctoberCms]
- → Passing a JS var from AJAX response to Twig
- → how to convert stdclass into string
- → Dynamic url segment name in laravel 5.1
- → Knockout JS - How to return empty strings for observable fields
- → How to replace *( in a string
- → Is this considered to be a custom facade approach in Laravel?
- → Regex extract string after the second "." dot character at the end of a string
- → Htaccess negation
- → Convert generic text string in json object into valid url using Angular