summaryrefslogtreecommitdiff
path: root/modules/mono/glue/cs_files/StringExtensions.cs
diff options
context:
space:
mode:
Diffstat (limited to 'modules/mono/glue/cs_files/StringExtensions.cs')
-rw-r--r--modules/mono/glue/cs_files/StringExtensions.cs40
1 files changed, 20 insertions, 20 deletions
diff --git a/modules/mono/glue/cs_files/StringExtensions.cs b/modules/mono/glue/cs_files/StringExtensions.cs
index a18c04b274..030d1282f3 100644
--- a/modules/mono/glue/cs_files/StringExtensions.cs
+++ b/modules/mono/glue/cs_files/StringExtensions.cs
@@ -82,9 +82,9 @@ namespace Godot
// </summary>
public static string[] Bigrams(this string instance)
{
- string[] b = new string[instance.Length - 1];
+ var b = new string[instance.Length - 1];
- for (int i = 0; i < b.Length; i++)
+ for (var i = 0; i < b.Length; i++)
{
b[i] = instance.Substring(i, 2);
}
@@ -97,7 +97,7 @@ namespace Godot
// </summary>
public static string CEscape(this string instance)
{
- StringBuilder sb = new StringBuilder(string.Copy(instance));
+ var sb = new StringBuilder(string.Copy(instance));
sb.Replace("\\", "\\\\");
sb.Replace("\a", "\\a");
@@ -119,7 +119,7 @@ namespace Godot
// </summary>
public static string CUnescape(this string instance)
{
- StringBuilder sb = new StringBuilder(string.Copy(instance));
+ var sb = new StringBuilder(string.Copy(instance));
sb.Replace("\\a", "\a");
sb.Replace("\\b", "\b");
@@ -141,12 +141,12 @@ namespace Godot
// </summary>
public static string Capitalize(this string instance)
{
- string aux = instance.Replace("_", " ").ToLower();
- string cap = string.Empty;
+ string aux = instance.Replace("_", " ").ToLower();
+ var cap = string.Empty;
- for (int i = 0; i < aux.GetSliceCount(" "); i++)
+ for (var i = 0; i < aux.GetSliceCount(" "); i++)
{
- string slice = aux.GetSlicec(' ', i);
+ string slice = aux.GetSlicec(' ', i);
if (slice.Length > 0)
{
slice = char.ToUpper(slice[0]) + slice.Substring(1);
@@ -259,12 +259,12 @@ namespace Godot
{
int basepos = instance.Find("://");
- string rs = string.Empty;
- string @base = string.Empty;
+ var rs = string.Empty;
+ var @base = string.Empty;
if (basepos != -1)
{
- int end = basepos + 3;
+ var end = basepos + 3;
rs = instance.Substring(end, instance.Length);
@base = instance.Substring(0, end);
}
@@ -378,7 +378,7 @@ namespace Godot
while (instance[src] != 0 && text[tgt] != 0)
{
- bool match = false;
+ var match = false;
if (case_insensitive)
{
@@ -446,7 +446,7 @@ namespace Godot
if (len == 0)
return false;
- for (int i = 0; i < len; i++)
+ for (var i = 0; i < len; i++)
{
if (i == 0)
{
@@ -482,7 +482,7 @@ namespace Godot
if (ip.Length != 4)
return false;
- for (int i = 0; i < ip.Length; i++)
+ for (var i = 0; i < ip.Length; i++)
{
string n = ip[i];
if (!n.IsValidInteger())
@@ -501,7 +501,7 @@ namespace Godot
// </summary>
public static string JsonEscape(this string instance)
{
- StringBuilder sb = new StringBuilder(string.Copy(instance));
+ var sb = new StringBuilder(string.Copy(instance));
sb.Replace("\\", "\\\\");
sb.Replace("\b", "\\b");
@@ -810,9 +810,9 @@ namespace Godot
float sum = src_size + tgt_size;
float inter = 0;
- for (int i = 0; i < src_size; i++)
+ for (var i = 0; i < src_size; i++)
{
- for (int j = 0; j < tgt_size; j++)
+ for (var j = 0; j < tgt_size; j++)
{
if (srcBigrams[i] == tgtBigrams[j])
{
@@ -838,9 +838,9 @@ namespace Godot
// </summary>
public static float[] SplitFloats(this string instance, string divisor, bool allow_empty = true)
{
- List<float> ret = new List<float>();
- int from = 0;
- int len = instance.Length;
+ var ret = new List<float>();
+ int from = 0;
+ int len = instance.Length;
while (true)
{