MCPcopy Index your code
hub / github.com/java-native-access/jna / replace

Method replace

src/com/sun/jna/Native.java:1728–1743  ·  view source on GitHub ↗
(String s1, String s2, String str)

Source from the content-addressed store, hash-verified

1726
1727 // No String.replace available in 1.4
1728 static String replace(String s1, String s2, String str) {
1729 StringBuilder buf = new StringBuilder();
1730 while (true) {
1731 int idx = str.indexOf(s1);
1732 if (idx == -1) {
1733 buf.append(str);
1734 break;
1735 }
1736 else {
1737 buf.append(str.substring(0, idx));
1738 buf.append(s2);
1739 str = str.substring(idx + s1.length());
1740 }
1741 }
1742 return buf.toString();
1743 }
1744
1745 /** Indicates whether the callback has an initializer. */
1746 static final int CB_HAS_INITIALIZER = 1;

Callers 14

testStringReplaceMethod · 0.95
getSignatureMethod · 0.95
accessCheckMethod · 0.80
getBinaryPackageNameMethod · 0.80
getMainClassBinaryMethod · 0.80
getBinaryPackageNameMethod · 0.80
assertLibraryExistsMethod · 0.80
runTestUnderWebStartMethod · 0.80

Calls 3

indexOfMethod · 0.45
lengthMethod · 0.45
toStringMethod · 0.45