如何像列表一样对待字节数组?

红888

我想删除字节数组的最后一个元素

但这些方法似乎都不受支持

def test = 'test.com'
print test.bytes.removeLast()
print '\n'
print test.bytes.dropRight(0)
弗里克

这些是数组,它们在 Groovy 中根本没有太多功能。您可以将它们转换为列表.toList()

groovy:000> test.bytes.toList().removeLast()
===> 109

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章