Kotlin 带索引的流上ForEach
是否可以在Kotlin 带索引的流上ForEach,kotlin,Kotlin,是否可以在流上使用某种形式的foreach方法并使用索引 如列表上的forachined{index,value->}?除非您想继续使用Java的流,否则您可以使用: 您的代码变成: stream.asSequence().forachined{…}除非您想继续使用Java的流,否则您可以使用: 您的代码变成: stream.asSequence().forachined{…}
流
上使用某种形式的foreach方法并使用索引
如
列表上的forachined{index,value->}
?除非您想继续使用Java的流,否则您可以使用:
您的代码变成:
stream.asSequence().forachined{…}
除非您想继续使用Java的流,否则您可以使用:
您的代码变成:
stream.asSequence().forachined{…}