aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/util/StringUtils.java
diff options
context:
space:
mode:
authorYana Stamcheva <yana@jitsi.org>2011-06-01 10:47:27 +0000
committerYana Stamcheva <yana@jitsi.org>2011-06-01 10:47:27 +0000
commit5cb8b89cbecb83efb6472e21c2bceae66eef4e23 (patch)
treeb5aef1e202f21427233d9913ec6d3212a02db5a4 /src/net/java/sip/communicator/util/StringUtils.java
parentf19eb013da71af8e60018406a5fca16b87c8a0fe (diff)
downloadjitsi-5cb8b89cbecb83efb6472e21c2bceae66eef4e23.zip
jitsi-5cb8b89cbecb83efb6472e21c2bceae66eef4e23.tar.gz
jitsi-5cb8b89cbecb83efb6472e21c2bceae66eef4e23.tar.bz2
Removes special symbols before callng phone numbers and lets the user configure a property to enable/disable this functionality.
Diffstat (limited to 'src/net/java/sip/communicator/util/StringUtils.java')
-rw-r--r--src/net/java/sip/communicator/util/StringUtils.java41
1 files changed, 40 insertions, 1 deletions
diff --git a/src/net/java/sip/communicator/util/StringUtils.java b/src/net/java/sip/communicator/util/StringUtils.java
index 6d903b4..a4f4024 100644
--- a/src/net/java/sip/communicator/util/StringUtils.java
+++ b/src/net/java/sip/communicator/util/StringUtils.java
@@ -7,7 +7,6 @@
package net.java.sip.communicator.util;
import java.io.*;
-import java.util.*;
/**
* Utility class that helps to work with <tt>String</tt> class.
@@ -195,4 +194,44 @@ public final class StringUtils
return true;
}
+
+ /**
+ * Indicates if the given string contains any letters.
+ *
+ * @param string the string to check for letters
+ * @return <tt>true</tt> if the given string contains letters,
+ * <tt>false</tt> - otherwise
+ */
+ public static boolean containsLetters(String string)
+ {
+ for (int i = 0; i < string.length(); i++)
+ {
+ if (Character.isLetter(string.charAt(i)))
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Removes all spaces from the given string and returns a concatenated
+ * result string.
+ *
+ * @param string the string to concatenate
+ * @return the concatenated string
+ */
+ public static String concatenateWords(String string)
+ {
+ StringBuffer buff = new StringBuffer();
+ char[] stringAsCharArray = string.toCharArray();
+
+ for (char character : stringAsCharArray)
+ {
+ if (character != ' ')
+ {
+ buff.append(character);
+ }
+ }
+ return buff.toString();
+ }
}