我有绳子

Intel Corporate|Lot 8, Jalan Hi-tech 2/3|Kulim Hi-tech Park|Kulim Kedah 09000|Malaysia
Samsung Electronics||#94-1, Imsoo-dong|Gumi Gyeongbuk 730-350|Korea, Republic Of


如何打印供应商名称,例如英特尔公司,三星电子?

最佳答案

看看String#split ...

我想你会发现类似...

String value = "Intel Corporate|Lot 8, Jalan Hi-tech 2/3|Kulim Hi-tech Park|Kulim Kedah 09000|Malaysia";
System.out.println(value.split("\\|")[0]);
value = "Samsung Electronics||#94-1, Imsoo-dong|Gumi Gyeongbuk 730-350|Korea, Republic Of";
System.out.println(value.split("\\|")[0]);


应该足够...

10-06 02:25