summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit/utils/StringUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/gitblit/utils/StringUtils.java')
-rw-r--r--src/com/gitblit/utils/StringUtils.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/gitblit/utils/StringUtils.java b/src/com/gitblit/utils/StringUtils.java
index a465e0d7..adede1fa 100644
--- a/src/com/gitblit/utils/StringUtils.java
+++ b/src/com/gitblit/utils/StringUtils.java
@@ -485,4 +485,11 @@ public class StringUtils {
}
return value;
}
+
+ public static int countLines(String value) {
+ if (isEmpty(value)) {
+ return 0;
+ }
+ return value.split("\n").length;
+ }
} \ No newline at end of file