• Post Reply Bookmark Topic Watch Topic
  • New Topic

Removing characters  RSS feed

 
lalit bairwal
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi every one can you tell me how to write the code for this program

write a method called delete(String x , int m)

that returns the input string with the mth element removed
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is your code? What problems are you having with it?

(Be sure to UseCodeTags when posting code.)
 
Vivek SharmaJi
Ranch Hand
Posts: 38
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear Bibeault for your message.

@Lalit: You can create delete(String x , int m) method. Take the string in a char array, once the position reaches where you want to delete the char don't let it insert in the char array, save this char and return from the method.Try this.
 
Campbell Ritchie
Marshal
Posts: 56576
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Please show us what you have already. We do not give out solutions at first; it is far better for the poster to think it out for themselves.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!