var btw = Request.Form[key + "_rcbBTW_ClientState"];
if (btw != null)
{
var indexOf = btw.IndexOf("\"value\":\"", StringComparison.Ordinal);
if (indexOf >= 0)
{
indexOf += 9;
var res = btw.Substring(indexOf, btw.IndexOf("\"", indexOf, StringComparison.Ordinal) - indexOf);
int id;
if (int.TryParse(res, out id)) regel.BTW_ID = id;
}
Looks to be trying to get the numeric value out of a (unparsed JSON?) string. People hate on regex, but that'd definitely be better than this... or just parse the JSON if it's that.
13
u/Robuuust Sep 29 '21
Code in text:
14
u/alaksion Sep 29 '21
what the fuck is this
20
u/minefreak19 Sep 29 '21
I don't understand
7
u/nekokattt Sep 29 '21
The += 9 just substrings the "value": part, right?
3
u/FranticBronchitis Sep 29 '21
I wonder if whoever wrote this uses Arch
1
u/ososalsosal Sep 30 '21
So many of these I can't tell what they're doing and then I look for clues in the function names and still don't know what they're doing
0
u/[deleted] Sep 29 '21
[deleted] — view deleted comment