[chronojump] New method Util.GetExtension
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] New method Util.GetExtension
- Date: Tue, 17 Sep 2019 11:30:57 +0000 (UTC)
commit 9e5402cfcbff321a0800187a3fa887d980004e3e
Author: Xavier de Blas <xaviblas gmail com>
Date: Tue Sep 17 13:24:49 2019 +0200
New method Util.GetExtension
src/util.cs | 10 ++++++++++
1 file changed, 10 insertions(+)
---
diff --git a/src/util.cs b/src/util.cs
index cf339f4f..4c884f05 100644
--- a/src/util.cs
+++ b/src/util.cs
@@ -1914,6 +1914,16 @@ public class Util
return myFile + extension;
}
+ //this includes the '.', eg: returns ".csv"
+ public static string GetExtension(string myFile)
+ {
+ int posOfDot = myFile.LastIndexOf('.');
+ if (posOfDot > 0)
+ return myFile.Substring(posOfDot);
+
+ return "";
+ }
+
public static string RemoveExtension(string myFile)
{
int posOfDot = myFile.LastIndexOf('.');
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]