diff --git a/docs/docs/reference/misc.md b/docs/docs/reference/misc.md index 1e64184..fd9ea33 100644 --- a/docs/docs/reference/misc.md +++ b/docs/docs/reference/misc.md @@ -48,3 +48,5 @@ func _ready() -> void: Converts an array into a string array. If an item is found that is not of type `String`, an empty array is returned. +### *Array* stringarray_to_array(*Array[String]* array) +Converts a string array into an array. diff --git a/src/Misc.gd b/src/Misc.gd index 886b480..d128cbe 100644 --- a/src/Misc.gd +++ b/src/Misc.gd @@ -71,3 +71,11 @@ func array_to_stringarray(array: Array) -> Array[String]: output.append(item) return output + +func stringarray_to_array(array: Array[String]) -> Array: + var output: Array = [] + + for item in array: + output.append(item) + + return output