使用LINQ选择数组中特定数量的单元格

时间:2016-03-12 09:14:42

标签: c# arrays linq

是否可以根据索引选择数组中特定数量的单元格?

例如选择从索引5到索引15的所有单元格。

我知道我们可以使用loop或array.copy()。

但我的问题是可以使用LINQ吗?

如果是,您可以粘贴演示代码吗?

和效率如何?

1 个答案:

答案 0 :(得分:2)

可以采用以下结构:

window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem) {
  var entry = fileSystem.root;
  entry.getDirectory("Directory_Name", { // Give your directory name instead of Directory_Name
    create: true,
    exclusive: false
  },onSuccess, onFail);
},null);

// onSuccess function for creating directory
 function onSuccess(parent) {
   dirPath = parent.nativeURL; // It will return location of the folder in device
   console.log(dirPath);
 }

// onFail function for creating directory
function onFail(error) {
  console.log(error);
}
相关问题