Skip to content

Commit 46ea84f

Browse files
shethaaditAdit Sheth
andauthored
Updated deprecated substr and relaced it with substring. (#58732)
Co-authored-by: Adit Sheth <adsheth@microsoft.com>
1 parent 7f62ae6 commit 46ea84f

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/JSInterop/Microsoft.JSInterop.JS/src/src/Microsoft.JSInterop.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export module DotNet {
7272
// However since we're the one calling the import keyword, they would be resolved relative to
7373
// this framework bundle URL. Fix this by providing an absolute URL.
7474
if (typeof url === "string" && url.startsWith("./")) {
75-
url = new URL(url.substr(2), document.baseURI).toString();
75+
url = new URL(url.substring(2), document.baseURI).toString();
7676
}
7777

7878
return import(/* webpackIgnore: true */ url);

src/SignalR/clients/ts/FunctionalTests/ts/HubConnectionTests.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ describe("hubConnection", () => {
302302
// client side method names are case insensitive
303303
let methodName = "message";
304304
const idx = Math.floor(Math.random() * (methodName.length - 1));
305-
methodName = methodName.substr(0, idx) + methodName[idx].toUpperCase() + methodName.substr(idx + 1);
305+
methodName = methodName.substring(0, idx) + methodName[idx].toUpperCase() + methodName.substring(idx + 1);
306306

307307
const receivePromise = new PromiseSource<string>();
308308
hubConnection.on(methodName, (msg) => {
@@ -328,7 +328,7 @@ describe("hubConnection", () => {
328328
// client side method names are case insensitive
329329
let methodName = "message";
330330
const idx = Math.floor(Math.random() * (methodName.length - 1));
331-
methodName = methodName.substr(0, idx) + methodName[idx].toUpperCase() + methodName.substr(idx + 1);
331+
methodName = methodName.substring(0, idx) + methodName[idx].toUpperCase() + methodName.substring(idx + 1);
332332

333333
let closeCount = 0;
334334
let invocationCount = 0;

src/SignalR/clients/ts/signalr/src/Utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export function formatArrayBuffer(data: ArrayBuffer): string {
8787
});
8888

8989
// Trim of trailing space.
90-
return str.substr(0, str.length - 1);
90+
return str.substring(0, str.length - 1);
9191
}
9292

9393
// Also in signalr-protocol-msgpack/Utils.ts

0 commit comments

Comments
 (0)