Java tutorial
//package com.java2s; public class Main { public static String getPollutantTypeByWebHtml(String htmlText) { if (htmlText == null) return ""; String type = ""; if (htmlText.equalsIgnoreCase("PM<sub>2.5</sub>")) { type = "PM2.5"; } else if (htmlText.equalsIgnoreCase("PM<sub>10</sub>")) { type = "PM10"; } else if (htmlText.equalsIgnoreCase("NO<sub>2</sub>")) { type = "NO2"; } else if (htmlText.equalsIgnoreCase("O<sub>3</sub>")) { type = "O3"; } else if (htmlText.equalsIgnoreCase("SO<sub>2</sub>")) { type = "SO2"; } else if (htmlText.equalsIgnoreCase("CO")) { type = "CO"; } return type; } }