Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Arrays 如何将从API获得的JSON数组与CSV文件中的普通Java数组进行比较?_Arrays_Json_Comparator - Fatal编程技术网

Arrays 如何将从API获得的JSON数组与CSV文件中的普通Java数组进行比较?

Arrays 如何将从API获得的JSON数组与CSV文件中的普通Java数组进行比较?,arrays,json,comparator,Arrays,Json,Comparator,我对比较JSON数组和简单java字符串数组的操作有点拘泥。因此,我有一个CSV文件,其中包含一列中的数据,我有一个字符串数组形式的数据 Ex-{ "https://google.com", "https://stackoverflow.com", "https://directi.com", "https://facebook.com" } 调用API时,我得到一个JSONARRAY,格式如下: ["h

我对比较JSON数组和简单java字符串数组的操作有点拘泥。因此,我有一个CSV文件,其中包含一列中的数据,我有一个字符串数组形式的数据

Ex-{ "https://google.com", "https://stackoverflow.com", "https://directi.com", "https://facebook.com" }
调用API时,我得到一个JSONARRAY,格式如下:

["https://google.com",
 "https://facebook.com",
 "https://stackoverflow.com",
 "https://directi.com"
 ]
我想比较这两个值,我无法找到任何解决方案

我曾想过提取JSONARRAY值并将其存储在字符串中,然后进行比较,但问题是CSV文件将整个数组存储为单个变量,而不是字符串。此外,API和字符串中的索引值也不同。但数据是一样的

Example: String CSV_value = { "https://google.com", "https://stackoverflow.com", "https://directi.com", "https://facebook.com" }
我该怎么做这个比较,谁能告诉我