【问题标题】:Google Directions API -- get XML response without HTML markupGoogle Directions API -- 获取没有 HTML 标记的 XML 响应
【发布时间】:2011-05-12 18:56:05
【问题描述】:

我正在开发一个 Android 应用程序并使用 Google Maps and Directions API。我能够成功地获得所有支持模式的 XML 方向。但是,它们都带有 HTML 标记。 有谁知道是否有办法在发出请求时省略标记,这样我就不必在应用程序中本地删除它? (例如:1.“右转Broad St.”等等,是我目前收到的。当然,这个词不是粗体的,但你实际上可以看到标签)。 谢谢。

【问题讨论】:

    标签: html android google-maps-api-3


    【解决方案1】:

    事实证明,使用 RegEx 很容易做到这一点:

    String directions = htmlDirections.replaceAll("\\<.*?\\>", "");

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-10-18
      • 2019-03-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-08-21
      • 1970-01-01
      相关资源
      最近更新 更多