# Padding Arrays

**URL:** <https://forums.swift.org/t/padding-arrays/41041>\
**Category:** Pitches\
**Tags:** swift, array\
**Created:** [October 9, 2020, 7:39am UTC](https://forums.swift.org/t/padding-arrays/41041 "2020-10-09T07:39:18Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![tevelee](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tevelee/32/9775_2.png) [@tevelee](https://forums.swift.org/u/tevelee)\
**Post date:** [October 9, 2020, 2:37pm UTC](https://forums.swift.org/t/padding-arrays/41041/3 "2020-10-09T14:37:12Z")

</div>

Foundation framework already provides a great API to achieve this with Strings:  
[https://developer.apple.com/documentation/foundation/nsstring/1416395-stringbypaddingtolength?language=Swift](https://developer.apple.com/documentation/foundation/nsstring/1416395-stringbypaddingtolength?language=Swift)

Do you have a real-life example where else this might be useful for non-string arrays?

---

_[View the full topic](https://forums.swift.org/t/padding-arrays/41041)._
