Skip to main content
Commonmark migration
Source Link

#SmileBASIC, 27 25 bytes

SmileBASIC, 27 25 bytes

DEF D S
S[0]=@1[S>"2"]END

Creates a function named D that is called like:

STRING$="abcde"
D STRING$
'STRING$ is now "1bcde"

The first character is replaced with either @ or 1

#SmileBASIC, 27 25 bytes

DEF D S
S[0]=@1[S>"2"]END

Creates a function named D that is called like:

STRING$="abcde"
D STRING$
'STRING$ is now "1bcde"

The first character is replaced with either @ or 1

SmileBASIC, 27 25 bytes

DEF D S
S[0]=@1[S>"2"]END

Creates a function named D that is called like:

STRING$="abcde"
D STRING$
'STRING$ is now "1bcde"

The first character is replaced with either @ or 1

added 28 characters in body
Source Link
12Me21
  • 6.7k
  • 1
  • 22
  • 40

#SmileBASIC, 2727 25 bytes

DEF SD S S[0]=@L[S[0]<@L]END
S[0]=@1[S>"2"]END

Creates a function named SD that is called like:

S$="abcde"STRING$="abcde"
SD S$STRING$
'S$'STRING$ is now "@bcde""1bcde"

The first character is replaced with either @ or L1

#SmileBASIC, 27 bytes

DEF S S S[0]=@L[S[0]<@L]END

Creates a function named S that is called like:

S$="abcde"
S S$
'S$ is now "@bcde"

The first character is replaced with either @ or L

#SmileBASIC, 27 25 bytes

DEF D S
S[0]=@1[S>"2"]END

Creates a function named D that is called like:

STRING$="abcde"
D STRING$
'STRING$ is now "1bcde"

The first character is replaced with either @ or 1

Source Link
12Me21
  • 6.7k
  • 1
  • 22
  • 40

#SmileBASIC, 27 bytes

DEF S S S[0]=@L[S[0]<@L]END

Creates a function named S that is called like:

S$="abcde"
S S$
'S$ is now "@bcde"

The first character is replaced with either @ or L