Skip to main content
Fixed bugs
Source Link
Luke
  • 4.8k
  • 16
  • 23

Japt, 810 bytes

r"%d*$"Vr"%d*$" +V

Try it online!Try it online!

Explanation

 r"%d*$"Vr"%d*$" +V
Ur"%d*$"VUr"%d*$" +V # Implicit input (U)
Ur and V)
 r     # In the first input string,# replaceRemove
  "%d*$"  #  # 0 or moreany trailing digits
U        V   # By  from the first input
         +V # And append the second input
            # Implicit output

Japt, 8 bytes

r"%d*$"V

Try it online!

Explanation

 r"%d*$"V
Ur"%d*$"V # Implicit input (U)
Ur        # In the first input string, replace
  "%d*$"  #   0 or more trailing digits
        V # By the second input
          # Implicit output

Japt, 10 bytes

r"%d*$" +V

Try it online!

 r"%d*$" +V
Ur"%d*$" +V # Implicit input (U and V)
 r          # Remove
  "%d*$"    #   any trailing digits
U           #   from the first input
         +V # And append the second input
            # Implicit output
Added explanation
Source Link
Luke
  • 4.8k
  • 16
  • 23

Japt, 8 bytes

r"%d+$"Vr"%d*$"V

Try it online!Try it online!

Explanation

 r"%d*$"V
Ur"%d*$"V # Implicit input (U)
Ur        # In the first input string, replace
  "%d*$"  #   0 or more trailing digits
        V # By the second input
          # Implicit output

Japt, 8 bytes

r"%d+$"V

Try it online!

Japt, 8 bytes

r"%d*$"V

Try it online!

Explanation

 r"%d*$"V
Ur"%d*$"V # Implicit input (U)
Ur        # In the first input string, replace
  "%d*$"  #   0 or more trailing digits
        V # By the second input
          # Implicit output
Source Link
Luke
  • 4.8k
  • 16
  • 23

Japt, 8 bytes

r"%d+$"V

Try it online!