MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / substring

Method substring

ij/src/main/java/ij/macro/Functions.java:2887–2900  ·  view source on GitHub ↗
(String s)

Source from the content-addressed store, hash-verified

2885 }
2886
2887 String substring(String s) {
2888 s = getStringFunctionArg(s);
2889 int index1 = (int)interp.getExpression();
2890 int index2 = s.length();
2891 if (interp.nextToken()==',')
2892 index2 = (int)getLastArg();
2893 else
2894 interp.getRightParen();
2895 if (index1>index2)
2896 interp.error("beginIndex>endIndex");
2897 checkIndex(index1, 0, s.length());
2898 checkIndex(index2, 0, s.length());
2899 return s.substring(index1, index2);
2900 }
2901
2902 private String getStringFunctionArg(String s) {
2903 if (s==null) {

Callers 15

getStringFunctionMethod · 0.95
getShortTitleMethod · 0.80
getStringPropertyMethod · 0.80
setPropMethod · 0.80
getPropsInfoMethod · 0.80
revertMethod · 0.80
runUserPlugInMethod · 0.80
showStatusMethod · 0.80
logMethod · 0.80
handleLogCommandMethod · 0.80
getValueMethod · 0.80
saveMethod · 0.80

Calls 8

getStringFunctionArgMethod · 0.95
getLastArgMethod · 0.95
checkIndexMethod · 0.95
getExpressionMethod · 0.80
getRightParenMethod · 0.80
lengthMethod · 0.65
nextTokenMethod · 0.45
errorMethod · 0.45

Tested by 15

newColorsMethod · 0.64
newValuesMethod · 0.64
newMinValueMethod · 0.64
newMaxValueMethod · 0.64
newSegmentsMethod · 0.64
longStringTestAnyMethod · 0.64
extractCommentMethod · 0.64
initializeMethod · 0.64
serveMethod · 0.64
testFitsSubstringMethod · 0.64