mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-03-02 01:19:14 +00:00
Strip all paras
This commit is contained in:
parent
c48fd2b818
commit
0bcb2ab268
@ -1951,6 +1951,30 @@ public class Utilities {
|
||||
return p;
|
||||
}
|
||||
|
||||
public static String stripAllPara(String p) {
|
||||
if (noString(p)) {
|
||||
return "";
|
||||
}
|
||||
p = p.trim();
|
||||
if (p.startsWith("<p>")) {
|
||||
p = p.substring(3);
|
||||
}
|
||||
if (p.endsWith("</p>")) {
|
||||
p = p.substring(0, p.length()-4);
|
||||
}
|
||||
p = p.replace("</p>", " ");
|
||||
p = p.replace("<p>", "");
|
||||
while (p.contains("<p ")) {
|
||||
int start = p.indexOf("<p ");
|
||||
int end = start;
|
||||
while (end < p.length() && p.charAt(end) != '>') {
|
||||
end++;
|
||||
}
|
||||
p = p.substring(start, end);
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//public static boolean !isWhitespace(String s) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user