Category : substring

I’m trying to extract a substring from an error message I receive and parse it to JSON. However it seems something with the indexOf or the substring method is not working as expected. Here’s the full error message I’m trying to parse: processing response error (body="{"jsonrpc":"2.0","id":223,"error":{"code":-32000,"message":"intrinsic gas too low"}}", error={"code":-32000}, requestBody="{"method":"eth_sendRawTransaction","params":["0xf8a85b843b9aca0082520894ad6d458402f60fd3bd25163575031acdce07538d80b844a9059cbb000000000000000000000000ca3f2ee61e5afd8072e351fff1e6da3d47e0e9ab0000000000000000000000000000000000000000000000000de0b6b3a764000029a0c9bc6207b2c1bd1413235f28200fef961acc00aa1e9c38fdb0c864a64441b5afa0169756bd13450d07c1bfbcbc12902d77015b832a1aab4d9a3f25b40d0259fa07"],"id":223,"jsonrpc":"2.0"}", requestMethod="POST") Basically I’m trying ..

Read more

I have a string like this that represents a "formula": IIF(HEADER("Z_LL5") == "ST_CONS", IIF(HEADER("Z_LL") == "BL", (SOURCE("P_QTY_FCST_CONS_BASE_U") * (SOURCE("P_QTY_LIFT_PERC") / 100)), SOURCE("P_QTY_FCST_TOT_VOL_U")), IIF(HEADER("Z_LL2") == "LT_CONS", IIF(HEADER("Z_LL") == "TV", 0, ((SOURCE("P_ST_OVERLAP_FCST_SHIP_LIFT") * HEADER("Z_LL5")) / 100)), 0)). I want to extract all the variable names that are contained in the "SOURCE" methods. So, I would like to ..

Read more

so I have this string "linear-gradient(90deg, rgba(243,231,231,1), rgba(12,0,0,0.48))" and I need to get 2 variables out of this const color1 = "rgba(243,231,231,1)" const color2 = "rgba(12,0,0,0.48))" or just only numbers so I can work with it The thing is I can’t just count characters and substring because my string with linear gradient is dynamic and ..

Read more