]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/model/LedgerTransactionItem.java
helper method fot getting the short account name
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / model / LedgerTransactionItem.java
index ff19a450251aef1077855d2862f21502cb42c0e8..3334706047813167f73bfb6c9afc309ed463931b 100644 (file)
@@ -40,6 +40,11 @@ public class LedgerTransactionItem {
     public String getAccountName() {
         return accountName;
     }
+    public String getShortAccountName() {
+        String result = accountName;
+        result = result.replaceAll("(?<=^|:)(.)[^:]+(?=:)", "$1");
+        return result;
+    }
 
     public void setAccountName(String accountName) {
         this.accountName = accountName;