[Pydev-cvs] org.python.pydev.core/src/org/python/pydev/core FullRepIterable.java,1.11,1.12
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2005-12-15 18:54:18
|
Update of /cvsroot/pydev/org.python.pydev.core/src/org/python/pydev/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20779/src/org/python/pydev/core Modified Files: FullRepIterable.java Log Message: Index: FullRepIterable.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.core/src/org/python/pydev/core/FullRepIterable.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** FullRepIterable.java 16 Nov 2005 13:28:40 -0000 1.11 --- FullRepIterable.java 15 Dec 2005 18:54:05 -0000 1.12 *************** *** 160,163 **** --- 160,166 ---- } + /** + * @return All that is after the last dot (or the whole string if there is no dot) + */ public static String getLastPart(String tokToCheck) { int i = tokToCheck.lastIndexOf('.'); *************** *** 168,171 **** --- 171,188 ---- } + /** + * @return All that is before the first dot (or the whole string if there is no dot) + */ + public static String getFirstPart(String tokToCheck) { + int i = tokToCheck.indexOf('.'); + if(i == -1){ + return tokToCheck; + } + return tokToCheck.substring(i+1); + } + + /** + * @return All that is before the last dot (or an empty string if there is no dot) + */ public static String getWithoutLastPart(String currentModuleName) { int i = currentModuleName.lastIndexOf('.'); |