What do you want to save?
Add Code snippet
New code examples
-
C# 2022-03-27 16:05:25
Find Number of Repetitions of Substring
using System; using System.Linq; public class Program { public static int NumberOfRepeats(string str) { int length = str.Length; int checkLength = 2; while (checkLength < length) { if (length % checkLength == 0) { var times ... Add solution -
C# 2022-03-17 06:45:03
c sharp substring
// To get a substring of a string use 'Substring()' // The first value is the index of where to start and the second // value is the lenght of the substring. string str = "Hello World!" str.Substring(3, 4) // Output: "lo W" // If yo... Add solution -
Javascript 2022-03-16 13:25:03
string split last slash in js get previous results
var str = "var1/var2/var3"; var rest = str.substring(0, str.lastIndexOf("/") + 1); var last = str.substring(str.lastIndexOf("/") + 1, str.length); console.log(rest); console.log(last); Add solution -
TypeScript 2022-03-06 00:05:30
typescript static class equivalent
//Example of Typescript static class equivalent export abstract class Tools { public static truncate(str, length) { var ending = '...'; if (str.length > length) { return str.substring(0, length - ending.length) + ending; } el... Add solution -
C# 2022-02-13 19:10:28
c# get first 5 characters of string
string result = str.Substring(0,5); Add solution
Best helpers
Ranking is empty