如何将字符串映射到URI? [英] How to map strings to URIs?

查看:244
本文介绍了如何将字符串映射到URI?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我说我有一个字符串连接uris。

Let me say that I have a single string concatenated uris.

http://...[sp]http://...[sp]http://...

我正在尝试将每个拆分字符串转换为URI。

I'm trying to convert each split string to URIs.

Stream.of(string.split("\\s")).map(uri -> URI::new);

编译器投诉。

Cannot infer type-variable(s) R

我做错了什么?

推荐答案

Stream.of(s.split("//s")).map(URI::new);

点击此处查看示例

这篇关于如何将字符串映射到URI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆