aboutsummaryrefslogtreecommitdiff
path: root/dotnet/Mammoth/Couscous/JavaStringExtensions.cs
blob: bf4e73f7dd126e7cd10e291c3d1a0d5e984e6f4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;

namespace Mammoth.Couscous {
    internal static class JavaStringExtensions {
        internal static char charAt(this string value, int index) {
            return value[index];
        }
        
        internal static bool equalsIgnoreCase(this string first, string second) {
            return first.Equals(second, StringComparison.InvariantCultureIgnoreCase);
        }
        
        internal static string replace(this string original, string search, string replacement) {
            return original.Replace(search, replacement);
        }
        
        internal static bool isEmpty(this string value) {
            return value.Length == 0;
        }
        
        internal static bool startsWith(this string value, string prefix) {
            return value.StartsWith(prefix);
        }
        
        internal static string trim(this string value) {
            return value.Trim();
        }
        
        internal static string[] split(this string value, string separator) {
            return System.Text.RegularExpressions.Regex.Split(value, separator);
        }
    }
}