g | x | w | all
Bytes Lang Time Link
011APLNARS250501T090624ZRosario
034Tcl180929T212108Zsergiol
001Vyxal220116T004914Zlyxal
001Thunno 2230610T133649ZThe Thon
026Befunge93220114T070929Zquintopi
010Factor220114T061844Zchunes
048Runic180929T194551ZDraco18s
030JavaScript180929T010244Zguest271
045MBASIC180924T153244Zwooshiny
001q180920T212844ZThaufeki
043PHP180924T160423ZFrancisc
00405AB1E180921T065013ZKevin Cr
017Stacked180924T145947ZConor O&
013Attache180924T142842ZConor O&
040R180922T091507ZJ.Doe
045Forth gforth180921T202925Zreffu
038Lua180920T205930ZMarcio M
012Backhand180921T032631ZJo King
015Haskell180920T194210ZH.PWiz
012Rebol180921T010430ZHappySpo
009><>180921T004949ZJo King
028TSQL180920T201956ZBradC
049QBasic180203T062203ZDLosc
034Cubically170809T220706ZTehPers
020Excel170809T094532ZWernisch
005APL Dyalog170809T063951ZAdá
047R170520T103239Zuser2390
023Braingolf170608T090432ZMayube
019C#170519T135345ZTheLetha
002Japt170519T140758ZLuke
022Bash170519T210631ZDrnglVrg
024><>170524T052018ZNot a tr
056Batch170523T114549ZNeil
041PHP170523T071230ZM.E
029Excel170520T123159Zpajonk
041Java 8170519T152829ZTheLetha
030REXX 30 Bytes170520T215929Ztheblitz
050C170520T190717ZMD XF
036shortC170520T191034ZMD XF
023SmileBASIC 3170520T182830Zsnail_
045R170520T152352ZSven Hoh
006sed170520T092708Zgdahlm
025Befunge98170519T212023Zovs
086Swift170520T042427ZMr. Xcod
014brainfuck170519T212238Zeush77
018Mathematica170519T140158ZZaMoC
012Alice170519T140820ZMartin E
008J170519T192426Zmiles
115Chip170519T191112ZPhlarx
007vim170519T135523ZDoorknob
044C gcc170519T145302ZYk Chees
003Jelly170519T181904ZJonathan
024Haskell170519T135947ZSgt. Dog
039BrainFlak170519T171348ZDJMcMayh
029Retina170519T170549Zeush77
031JS ES6170519T135437Zuser5882
048Javascript ES6170519T155451Zuser6953
025GCC c function170519T161301ZDigital
016Ruby170519T154622ZAlex
037Braingolf170519T152126ZMayube
028QBIC170519T150101Zsteenber
001K Kona170519T151551ZSimon Ma
003V170519T152005ZDJMcMayh
039Java 8170519T145353ZKevin Cr
042PHP170519T145043ZJör
037Lua170519T144900ZFelipe N
050Go170519T144630Ztotallyh
007Vim170519T143828Zjmriego
033JavaScript ES6170519T140310ZShaggy
025PowerShell170519T142927Zcolsw
003MATL170519T140539ZLuis Men
003Pyth170519T141537ZErik the
002Japt170519T140657ZTom
00605AB1E170519T140441ZEmigna
00505AB1E170519T140307ZRiley
004Jelly170519T135758Zfireflam
019Perl 5170519T135834ZDada
004CJam170519T135555ZBusiness
024Python 3170519T135351ZLeaky Nu

APL(NARS), 11 chars

{⍵[⍺∼⍨⍳≢⍵]}

All 1 indexed... test:

  1{⍵[⍺∼⍨⍳≢⍵]}1 2 3 4 5 8
2 3 4 5 8 

Tcl, 34 bytes

proc R n\ s {string repl $s $n $n}

Try it online!

Vyxal, 1 byte

Try it Online!

I don't know why I didn't use the built in

Thunno 2, 1 byte

Ɗ

Attempt This Online!

Built-in.

Befunge-93, 26 bytes

&>1# -#,:#~_~~>:# 1#~+#,_@

Try it online!

1-indexed, does NOT require a null byte at the end of the string because that's lame. However, if you really want to get all "let's screw with the input format to make the code shorter", here is one that saves 3 bytes by assuming a null terminator:

&>1# -#,:#~_~~>:#~ #,_@

Factor, 10 bytes

remove-nth

Try it online!

Runic, 48 bytes

   /~~{ R:1(?\~@
/3{\?)0:\S{-1/
\s3s}}1-U}:irui<

Try it online!

Not all test cases work at the moment: a few (more) flaws discovered in the parser.

Other test cases work (and are considered 0-indexed).

Explanation

Flow

Program starts in the lower right (red), reads a string, unconcatenates it, reverse it (so the first character is at the top of the stack; behavior is so that u followed by q results in concatenation in the desired order, and q works the way it does because >'a'bq, >`ab`q, and >"ab" should all have the same result). Then the program reads the integer value and assumes (per question spec) that it is in the range [0,L), values above this range will simply loop (effective %). This value is duplicated and stored at the bottom of the stack for later.

The lower left portion (yellow) is the section responsible for shifting the string around on the stack N times, where N is the input value. The 3s3s portion rotates the top 2 items on the stack below the 3rd (which results in the front-most character in the string being rotated to the end without affecting the positions of the two counters with the next two } rotates). It exits this branch along the top (green), heading right and popping 2 values (the loop counter and then the character to discard) and rotating the saved input value back to the top.

The top right (blue) then loops the remaining characters back into place in reverse, exiting the loop (purple) towards the @ which discards the remaining loop counter and prints the stack top to bottom.

Picture has a mistake, along the bottom are some stack manipulators, }}}{ and in typing up this post I noticed that }{ cancels out and saves 3 bytes.

JavaScript 30 bytes

(n,[...s])=>(s[n]='',s.join``)

Try it online!

MBASIC, 46 45 bytes

1 INPUT N,S$:PRINT LEFT$(S$,N-1);MID$(S$,N+1)

Just slamming substrings together, 1-indexed.

Output:

? 4,314151
31451

? 5,1234.5
12345

? 4,+-*/
+-*

? 3,a != b
a = b

? 2,abcde
acde

? 1,abcde
bcde

q, 6 1 byte

_

Test Cases

q)"abcde"_0
"bcde"
q)"abcde"_1
"acde"
q)"a != b"_2
"a = b"
etc.

PHP, 43 Bytes

Try it online

run as pipe.

Code

<?=strtr(($s=$argv)[0],[$s[0][$s[1]]=>""]);

Explanation

<?=strtr(($s=$argv)[0],        # Set a shorter name for the $argv arguments var
          [$s[0][$s[1]]=>""]); # Replace for "" in the position

05AB1E, 4 bytes

IõIǝ

Try it online or verify all test cases.

or alternatively

õŠŠǝ

Try it online or verify all test cases.

Explanation:

I       # Take the first string input
 õ      # Push an empty string
  I     # Take the second index-integer input
   ǝ    # Replace the character at the given index with the empty string

õ       # Push an empty string
 ŠŠ     # Triple-swap twice; a,b,c → c,a,b → b,c,a (implicitly using the two inputs)
        #  (`c` is the empty string here, `a` and `b` the input)
   ǝ    # Replace the character at the given index with the empty string

Stacked, 17 bytes

{%y:0\#'..x-keep}

Try it online!

Explanation

{%y:0\#'..x-keep}    anonymous lambda, takes input on the stack
{%              }    parameters: x, y
  y:                 push y twice             [y, y]
    0\               push 0 beneath           [y, 0, y]
      #'             push size of TOS         [y, 0, size(y)]
        ..           range                    [y, range(0, size(y))]
          x-         subtract x from this     [y, range(0, size(y)) - x]
                     (thus x-x = 0)
            keep     keep respective chars    [the answer]
                     this removes the character at the `x`th index

Attache, 13 bytes

{_[0:#_^^_2]}

Try it online!

Explanation

{_[0:#_^^_2]}
{           }    anonymous lambda (_ = 1st argument, _2 = 2nd argument)
   0:#_          range from 0 to the length of _
       ^^_2      ...without the 2nd argument
 _[        ]     obtain characters from _ using that range

R, 40 bytes

Just goes to show the variety of ways, none of which particularly compact, you can fiddle with strings in R.

function(s,n)intToUtf8(utf8ToInt(s)[-n])

Forth (gforth), 45 bytes

: f tuck - 1- -rot 2dup type + 1+ swap type ;

Try it online!

0-indexed, n should be on top of the stack

Explanation

Prints the string up to the given character, then prints the remainder of the string after the given character

Code Explanation

\ since a lot of stack manipulation is happening, I will be including a listing of the
\ stack after each step. s = string address, g = length of string, n = char to remove
: f          \ starts a new word definition                                     | s g n
  tuck -     \ store a copy of n, then get the length of the end of the string  | s n g-n
  1-         \ subtract 1 from the length of the end ( to not output junk)      | s n g-n-1
  -rot       \ move the end-string length to the back of the stack              | g-n-1 s n
  2dup type  \ duplicate the address and length of the first output, then print | g-n-1 s n
  + 1+       \ get the starting address for the second output                   | g-n-1 s+n+1
  swap type  \ swap to get in proper order, then print                          | 
;            \ end word definition                                              |

Lua, 51 38 bytes

Lowered to 38 bytes thanks to Jo King

x,y=...print(y:sub(1,x-1)..y:sub(x+1))

Try it online!

Just like everything else in Lua this is 1-indexed.

Explanation

Lua uses a table called arg to store arguments and the function sub() returns a substring of the string passed.

This is my first code golf entry, please be nice :)

Backhand, 12 bytes

{I>{{[ ~:oi_

Try it online!

Gets the inputted number followed by the string. 1 indexed.

Haskell, 15 bytes

This requires the recently released GHC 8.4.1 (or higher). Now <>, as a function on Semigroups, is in Prelude. It is particularly useful on the function Semigroup

take<>drop.succ

Try it online!
Since tio is using an older bersion of GHC, I've imported <> in the header.

Rebol, Red - 12 bytes

 remove at s n

><>, 9 bytes

i$:&?o&1-

Try it online!

Takes in the number via the -v flag and the string through STDIN. This is 0 indexed and ends with an error. You can add 5 bytes to avoid the error.

Explanation:

i           Get inputted character
 $          Swap and bring counter to the top
  :&        Store a copy in the register
    ?o      If the counter is not zero, print the character
      &1-   Restore and decrement the counter

T-SQL, 28 bytes

SELECT STUFF(s,n,1,'')FROM t

Input is taken via a pre-existing table t with integer n and string s, per our IO standards.

I'm assuming n is 1-based, so I can pass it straight into the SQL Stuff function. STUFF inserts or replaces the characters at the given location, and in my case I'm replacing a single character with a blank.

QBasic, 49 bytes

Uses 1-indexing.

INPUT n
LINE INPUT s$
?LEFT$(s$,n-1)+MID$(s$,n+1)

Reads a number and a string, and then prints the leftmost n-1 characters of the string plus everything from index n+1 to the end of the string.

Cubically, 46 56 34 bytes

R3D1R1$:7~?6{(~@7-0)6}~(~-0=7&6@7)

(0-based index)

Try it online! You must change &6 to ?6& on TIO due to a bug in the interpreter.

How it works

R3D1R1$:7~?6{(~@7-0)6}~(~-0=7&6@7)
R3D1R1                             Set the top face to 1
      $                            Get next numeric input
       :7                          Set notepad to input
         ~                         Read (skip) next character (space)
          ?6{        }             If notepad is nonzero
             (     )6              While notepad is nonzero
              ~@7                  Print next inputted character
                 -0                Subtract 1 from notepad
                      ~            Read (skip) next character
                       (         ) Loop indefinitely
                        ~          Get next character
                         -0=7&6    Exit program if input is -1 (EOF)
                               @7  Output the input

Excel, 20 bytes

Different approach from previous Excel answer.

1-indexed n in A1. Text in B1.

=REPLACE(B1,A1,1,"")

APL (Dyalog), 5 bytes

Zero-indexed. Takes index n as left argument and string s as right argument.

↑,1↓↓

Try it online!

n characters from s

, followed by

1↓ one character dropped from

n characters dropped from s

R, 48 47 bytes

(1 byte saved through use of el() thanks to Giuseppe)

function(s,n)cat(el(strsplit(s,""))[-n],sep="")

Split the string into its individual characters, remove the nth and then concatenate again.

There may well be a better solution, strsplit() is quite unwieldy as it returns a list.

Braingolf, 23 bytes

VRMv.1-[R<v]R$_[R>v]R&@

Try it online!

Not at all golfy

C#, 20 19 bytes

s=>n=>s.Remove(n,1)

Japt, 3 2 bytes

jV

Try it online!

Bash, 83 24 22 bytes

echo ${1::$2-1}${1:$2}

24 bytes answer given by Digital Trauma

-2 bytes, quotation marks not needed

My first GodeGolf answer, any feedback is apreciated

><>, 24 bytes

i:0(?v$1-:}?!~{
;?(3l<o{

Try it online, or at the fish playground

Takes the string as input from STDIN, and assumes the number for the index is already on the stack; outputs to STDOUT. It's 1-indexed.

The fish reads the string one character at a time, except it forgets the nth one after it reads it. It then prints the stack (in reverse) until there are only two (junk) things left.

Example: 4 and Boarfish becomes Boafish.

Batch, 56 bytes

@set/ps=
@set/ai=%1+1
@call echo %%s:~0,%1%%%%s:~%i%%%

Takes n 0-indexed as a command-line parameter and reads s from STDIN.

PHP, 41 bytes, 35 bytes excluding ?php

<?php $argv[1][$argv[2]]='';echo$argv[1];

0-indexed

TIO

Excel, 29 bytes

=LEFT(A1,A2)&MID(A1,A2+2,9^9)

Assumes input in cells A1 (string) and A2 (integer, 0-indexing).

Takes the left part of the string with LEFT and the right part - actually a substring starting on position A2+2 and 9^9 characters long (which is more then the max string length in one cell: 32,767 characters).

Java 8, 45 41 bytes

s->n->new StringBuffer(s).deleteCharAt(n)

Saved 4 bytes thanks to @OlivierGrégoire

My first code golf answer in something other than C#, even if it isn't the shortest for Java yet.

REXX 30 Bytes

parse arg p x
say delstr(x,p,1)

C, 57 50 bytes

#define f(s,n)for(i=n;s[i];i++)s[i]=s[i+1];puts(s)

0-indexed, naturally. I call this macro with:

int main(int argc, char **argv)
{
    if (argc != 3)
        return;
    f(argv[1],atoi(argv[2]));
}

shortC, 36 bytes

Df(s,n)Oi=n;s[i];i++)s[i]=s[i+1];Js)

See my plain C answer for how to call the macro.

SmileBASIC 3, 23 bytes

We have character indexing, why not use it? Set a character index to the empty string to delete it.

Defines a command A which prints the output. Uses 0-indexing.

DEF A S,N
S[N]="
?S
END

R, 45 bytes

pryr::f(sub(paste0("(.{",n-1,"})."),"\\1",s))

(s)ed - 6 bytes

1-based indexing.

s/.//n

Explanation:

s       # substitute command.
 /./    # match any single char.
   //   # substitution is empty.     
     n  # Only match the 'n'th occurrence in a line. 

Befunge-98, 35 27 25 bytes

-4 bytes thanks to @eush77

&#;1-:!#v_~,;
_@#:~;#~<;,

Try it online!

1-indexed, note that the input has a trailing null-byte.

Swift - 86 bytes (0-indexed)

func l(s:String,n:Int){var a=s;a.remove(at:a.index(a.startIndex,offsetBy:n));print(a)}

Function that can be used as l(s:"abcdefg",n:3)

Check it out!


Swift - 120 bytes

Since I thought the above is quite boring, I came up with another solution:

func l(s:String,n:Int){let b=s.startIndex;print(s[b...s.index(b,offsetBy:n-1)]+s[s.index(b,offsetBy:n+1)..<s.endIndex])}

Works as the one below, it's just more interesting.

brainfuck, 14 bytes

,[>,.<-],,[.,]

Try it online!

Reads zero-based one-byte index immediately followed by the string.

Mathematica, 18 bytes

1-indexed

#2~StringDrop~{#}&

input

[1, "abcde"]

thanks Martin Ender

Alice, 13 12 bytes

Thanks to Leo for saving 1 byte.

/oI\!e]&
@ q

Try it online!

First line of the input is the string, second line is the 0-based index.

Explanation

/    Reflect to SE. Switch to Ordinal. While in Ordinal mode, the IP bounces
     diagonally up and down through the code.
I    Read the first line of input (the string).
!    Store the string on the tape, which writes the characters' code points to 
     consecutive cells (the tape is initialised to all -1s).
]    Move the tape head right. This moves it by an entire string, i.e. to the
     cell after the -1 that terminates the current string.
     The IP bounces off the bottom right corner and turns around.
]    Move the tape head right by another cell.
!    Store an implicit empty string on the tape, does nothing. It's actually
     important that we moved the tape head before this, because otherwise it
     would override the first input code point with a -1.
I    Read the second line of input (the index) as a string.
/    Reflect to W. Switch to Cardinal.
     The IP wraps around to the last column.
&]   Implicitly convert the first input to the integer value it contains
     (the index) and move the tape head that many cells to the right, i.e.
     onto the character we want to delete. Note that Ordinal and Cardinal mode
     have two independent tape heads on the same tape, so the Cardinal tape
     head is still on the first cell of the string input before we do this.
e!   Store a -1 in the cell we want to delete.
\    Reflect to SW. Switch to Ordinal.
q    Push the entire tape contents as a single string. This basically takes
     all cells which hold valid code points from left to right on the tape 
     and concatenates the corresponding characters into a single string. Since
     we wrote a -1 (which is not a valid code point) over the target character,
     this will simply push the entire input string without that character.
o    Output the result.
@    Terminate the program.

J, 8 bytes

{.,1}.}.

Uses zero-based indexing.

Try it online!

Explanation

{.,1}.}.  Input: integer n (LHS), string s (RHS)
      }.  Drop the first n chars of s
   1}.    Drop one char from that
{.        Take the first n chars of s
  ,       Join them

Chip, 115 bytes

*Z~S
,x.z.
`@z\{Aa
,x.|*
`@z\{Bb
,x.|
`@z\{Cc
,x.|*
`@z\{Dd
,x.|
`@z\{Ee
,x.|*
`@z\{Ff
,x.|
`@z\{Gg
,x.|*
`@z\{H
 S

The first byte of input is a 0-based index, the remainder is the string to process: \x02abcde.

Try it online!
In this TIO, a newline character is the index, which means an index of 0x0a = 10.

Test cases!
These use hex input + printf to make it clearer what's happening.

How does it work?

*Z~S

This suppresses output on the first byte, because we don't want to print the index. That'd be silly.

Aa, Bb, Cc, etc.

These relay the input to the output for every byte, unless suppressed. Note that the h is missing, this is because we never need to output something with the high bit set.

,x.
`@z\{D

This is the real meat of it all. There are eight of these, one for each bit of the index (a one-byte index means that indexes are not able to be specified above 255). This reads in the index on the first cycle only with switches (\). The index bits have been flipped with an xor gate ({), which is almost negation. Then, for each character of the string, this value is incremented via some half-adders (@). When this value is incremented from 0xff to 0x00, it uses the carry from the high bit to suppress output (S) for that character, effectively removing it from the string.

vim, 10 7

DgJ@"|x

Takes 1-indexed input in the following format:

2
abcde
D      delete the number on the first line into register "
gJ     remove the newline while preserving whitespace on line 2
@"     run the " register as a macro - input is used as a count for...
|      the "go to nth column" command
x      delete the character at the cursor

Thanks to @DJMcMayhem for 3 bytes!

C (gcc) - 45 44 bytes

-1 Thanks to @Niel !

f(s,n)char*s;{for(;*s;++s)n--&&putchar(*s);}

alternative, 45 bytes :

g(s,n)char*s;{s[n++]=0;printf("%s%s",s,s+n);}

try it online

Jelly, 3 bytes

Ṭœp

A full program taking the (1-based) index and the string (in that order) and printing the result.

As a dyadic function it returns a list of the two parts.

In fact the index may be a list of n indices, in which case it returns a list of the n-1 parts.

Try it online!, or see a test suite.

How?

Ṭœp - Main link: number i, string s                   e.g. "fish 'n chips", 6
Ṭ   - untruth - get a list with 1s at the indexes of i      000001 <-- i.e. [0,0,0,0,0,1]
 œp - partition s at truthy indexes without borders       ["fish ","n chips"]
    - implicit print                                        fish n chips

As an example of using multiple indexes:

      "fish and chips", [6,8]
Ṭ      00000101 <- i.e. [0,0,0,0,0,1,0,1]
 œp  ["fish ","n"," chips"] 
       fish n chips

Haskell, 28 24 Bytes

-4 byte thanks to Laikoni, this version is 1-indexed.

s#n=take(n-1)s++drop n s

Old answer:

f(s:t)0=t;f(s:t)n=s:f t(n-1)

A simple recursive function that takes the value, it's 0-indexed.

My first time code-golfing so maybe it's not the optimal solution. Oh well.

Brain-Flak, 39 bytes

{({}<({}<>)<>>[()])}{}{}<>{({}<>)<>}<>

Try it online!

This has a one byte penalty for the -c flag which enables ASCII input and output. This takes the first parameter as a character code, which OP has allowed.

So the input is

0x01abcde

This uses zero indexing. Unfortunately, TIO doesn't allow null bytes in input, but this works locally so it's not an issue.

Retina, 29 bytes

1`\d+
$*	
+`(	+)	(.)
$2$1
	.

Try it online!

The index and the string are on the same line separated by one tab. The index is zero-based.

JS (ES6), 41 32 31 bytes

y=>i=>y.slice(0,i++)+y.slice(i)

Based on this. Takes input through currying, first is string, second is index.

-9 thanks to @JohanKarlsson

-1 thanks to @ETHproductions

Javascript (ES6), 48 bytes

x=>i=>x.substring(0,i-1)+x.substring(i,x.length)

Or this (55 bytes)

n=[],x=>i=>x.split``.forEach((_,i)=>i==x?0:n.push(_))

GCC c function, 25

1-based indexing.

f(n,s){strcpy(s-1,s+=n);}

Plenty of undefined behavior here so watch out for stray velociraptors:

Try it online.

Ruby, 16 bytes

->n,s{s[n]='';s}

Try it online!

Braingolf, 38 37 bytes

VVR<lMMv.M2+-[R<vv]R$_v.?1-[R<v]|R&@;

Try it online!

0-based index

As always with Braingolf, the TIO link includes the entire Python3 parser. The code is the 2nd argument, the index is the 3rd argument, and the string is the 4th argument.

QBIC, 28 bytes

B=@ `+B?_t_s;,:|+_sB,a+2,_lB

This is an adaptation of my Substring Subtraction answer.

Explanation:

B=@ `+B     Prepend a space to the input string
?           PRINT
 _t           a trimmed version (drops the space again)
   _s         SUBSTRING
     ;,:|       Read B$ from cmd line, read n from cmd line
                SUBSTRING with a stirng and a positive N takes chars 1-N from the left.
   +_sB       Plus a second substring
     ,a+2       Starting behind the removee-index
     ,_lB       taking all the remaining characters

This could go all the way down to 22 bytes if I didn't need that hacky space prepended. Time to change Substring-behaviour for this use-case...

?_s;,:-1|+_sA,a+1,_lA

K (Kona), 1 byte

_

Gotta love builtins. 0-based indexing. Usage:

k)"abcdef" _ 3
"abcef"

V, 3 bytes

À|x

Try it online!

This uses 1-indexing.

Java 8, 39 bytes

s->n->s.substring(0,n)+s.substring(n+1)

Try it here.

Java 7, 67 bytes

String c(int n,String s){return s.substring(0,n)+s.substring(n+1);}

Try it here.

PHP, 42 Bytes

0 indexed

<?=substr_replace($argv[1],"",$argv[2],1);

Try it online!

Lua, 37 bytes

Uses 0 indexing

s,i=...
print(s:sub(1,i)..s:sub(i+2))

Try it online!

Go, 50 bytes

1-indexed because we're all human, I think.

func f(s string,n int)string{return s[:n-1]+s[n:]}

Try it online!

Vim, 7 bytes

jDk@"|x

How it works:

It expects two lines; one with the string and one with the number.

  1. Go to line two, copy the number into register
  2. Go to first line and then go to column in the register with @"|
  3. Delete the character under the cursor

JavaScript (ES6), 39 34 33 bytes

n=>s=>s.replace(/./g,c=>n--?c:"")

PowerShell, 25 Bytes

3 Options, all the exact same bytecount.

$a,$b=$args;$a|% *ve $b 1

$args[1]|% *ve $args[0] 1

param($a,$b)$a|% *ve $b 1

calls .Remove on the string, using the number as an arg.

MATL, 3 bytes

&)&

Uses 1-based indexing.

Try it online! Or verify all test cases.

Explanation

&    % Specify secondary default number of inputs/outputs for next function
)    % Implicitly input string and number. Index: with & it pushes the char
     % defined by the index and the rest of the string
&    % Specify secondary default number of inputs/outputs for next function
     % Implicitly display (XD): with & it only displays the top of the stack

In the modified version with all the test cases, the code is within an infinite loop `...T until no input is found. At the end of each iteration the display function (XD) is explicitly called, and the stack is cleared (x) to ready it for the next iteration.

Pyth, 3 bytes

.DE

Try it here.

Takes index first.

Japt, 2 bytes

jV

Try it online!

05AB1E, 6 bytes

vNÊiy?

Try it online!

Explanation

v       # for each element, index (y,N) in input1
 NÊi    # if N is not equal to input2
    y?  # print y

05AB1E, 5 bytes

ā²ÊÏJ

Try it online!

ā     # push range(1, len(input string) + 1)
 ²Ê   # Check each for != to input index
   Ï  # Keep characters from input where this array is 1
    J # Join

Jelly, 4 bytes

Jḟị³

Try it online!

Explanation

Jḟị³
J    - all indices of the input string
 ḟ   - except for the input index
  ị  - return the elements at those indices
   ³ - of the input string

Perl 5, 19 bytes

18 bytes of code + -p flag

substr($_,<>,1)=""

Try it online!

substr($_,<>,1) returns 1 character at index <> (the 2nd input) in the string $_ (the input). And ="" changes it to "". And $_ is implicitely printed at the end thanks to -p flag.

CJam, 4 bytes

q~Lt

Try it online!

Explanation

q~    e# Read and eval input (push the string and number to the stack).
  Lt  e# Set the nth element of the string to the empty string.

Python 3, 24 bytes

lambda n,a:a[:n]+a[n+1:]

Try it online!