APL (Dyalog), 11(削除) 11 (削除ここまで) 8 bytes
3 bytes saved thanks to @Bubbler!
'⊃'(|)D'⍳ ̄1∘↑'⍳⌽
⌽ reverse the string
⊃ take the last (now first) byte
'(|)'⍳ index inside '(|)' (if not found ('D') returns the length (3))
APL (Dyalog), (削除) 11 (削除ここまで) 8 bytes
3 bytes saved thanks to @Bubbler!
⊃'(|)'⍳⌽
⌽ reverse the string
⊃ take the last (now first) byte
'(|)'⍳ index inside '(|)' (if not found ('D') returns the length (3))