Parse
класса JArray
вместо того же от JObject
:string json = @"[
'Small',
'Medium',
'Large'
]";
JArray a = JArray.Parse(json);
wait.Until(x => {
var size =
x.FindElement(By.CssSelector(selector)).GetAttribute("value").Length;
if (size >= 5) {
return true;
} else {
Console.Error.Write("waiting for specific text length");
return false;
}
});
[DllImport("user32.dll")]
public static extern int EnumDisplaySettings(string deviceName, int modeNum, ref DEVMODE1 devMode);
public struct DEVMODE1 {
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] public string dmDeviceName;
// детали
DEVMODE1 dm = new DEVMODE1();
User_32.EnumDisplaySettings(null, User_32.ENUM_CURRENT_SETTINGS, ref dm)) ;
x = 1;
Console.Error.WriteLine(x=" + x.ToString()); // undefined
x
matches[pos].Groups[1].ToString();
Add-Type -IgnoreWarnings -TypeDefinition @'
using System;
using System.Text;
using System.Text.RegularExpressions;
public class Test {
public string findMatches(string text, int pos) {
MatchCollection matches = Regex.Matches(text,@"([a-z]+)", RegexOptions.Singleline | RegexOptions.IgnoreCase);
Console.Error.WriteLine(matches.Count);
Console.Error.WriteLine(matches[pos].Groups.Count);
return matches[pos].Groups[1].ToString();
}
}
'@
$o = new-object -TypeName 'Test'
write-output ('=> "{0}"' -f $o.findMatches("a b c d", 3))
Regex.IsMatch(peremennaya.Trim(), "Text")