þмS¡þO
ลองออนไลน์
คำอธิบาย:
þм # Only leave the non-digits of the (implicit) input-string
# i.e. "the 5is 108 seCONd4 a" → "the is seCONd a"
S # Split it into a list of characters
# → ["t","h","e"," ","i","s"," "," ","s","e","C","O","N","d"," ","a"]
¡ # Split the (implicit) input-string by each of these characters
# → ["","","","","5","","","108","","","","","","","4","",""]
þ # Remove the empty strings by only leaving the digits
# → ["5","108","4"]
O # And sum these numbers (which is output implicitly)
# → 117
"the 5is 108 seCONd4 a"จะส่งผลให้117เพราะ5+108+4=117) นอกจากนี้ทุกคน 'คำถาม' ที่นี่ควรจะมีแท็กสภาพชนะ ในกรณีนี้ฉันคิดว่ามันเป็น [code-golf] (เป็นทางออกที่สั้นที่สุด)