[Android] src: Add an utility function to strip spaces

Edward Wang git at videolan.org
Thu Jun 21 19:55:50 CEST 2012


android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Thu Jun 21 12:06:00 2012 -0400| [ed58e0118e8bca82528529015868327afd19aa68] | committer: Edward Wang

src: Add an utility function to strip spaces

> http://git.videolan.org/gitweb.cgi/android.git/?a=commit;h=ed58e0118e8bca82528529015868327afd19aa68
---

 vlc-android/src/org/videolan/vlc/Util.java |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/Util.java b/vlc-android/src/org/videolan/vlc/Util.java
index cbb054d..a5412b1 100644
--- a/vlc-android/src/org/videolan/vlc/Util.java
+++ b/vlc-android/src/org/videolan/vlc/Util.java
@@ -61,6 +61,13 @@ public class Util {
         return URI;
     }
 
+    public static String stripTrailingSlash(String _s) {
+        String s = _s;
+        if(s.endsWith("/"))
+            s = s.substring(0,s.length()-1);
+        return s;
+    }
+
     /**
      * Convert time to a string
      * @param millis e.g.time/length from file



More information about the Android mailing list