Results for “sub”
Small, practical examples. Search by task or narrow things down below.
Calculate a subtotal
Calculate a subtotal using a complete Go program with explicit sample inputs.
Go✓ Tested
Calculate an order subtotal
Calculate an order subtotal in a complete Rust program using the standard library.
Rust✓ Tested
Check for a substring
Perform a case-sensitive JavaScript substring check.
JavaScript✓ Tested
Clean up a subscription when a child unmounts
Clean up a subscription when a child unmounts with a small React component and explicit browser behavior.
React✓ Tested
Extract a known substring
PowerShell: Substring uses a zero-based starting index and a character count.
PowerShell✓ Tested
Extract a substring by offset and length
Bash Scripts: Bash substring offsets start at zero for an ordinary string.
Bash Scripts✓ Tested
Extract a substring with an explicit count
C++: The second substr argument is a length rather than an ending index.
C++✓ Tested
Extract a substring with range syntax
C#: C# range ends are exclusive; indices operate on UTF-16 code units.
C#✓ Tested
Find a substring
Check the result of std::string::find against npos.
C++✓ Tested
Find a substring
Use strstr to find a literal substring in a C string.
C✓ Tested
Handle a template-driven form submission
Handle a template-driven form submission with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Identify the selected submit action
HTML: Each submit button can supply its own named value for the same form.
HTML✓ Tested