By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 663 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

Removing Apart Of String

P: 32
Hi a simple questin in got is whythe remove thing doesent always work
if your starting integer is 0 and ending integer is like 10 its fine
Expand|Select|Wrap|Line Numbers
  1.  
  2. string =  textbox1.text.remove(0,10)
  3.  
  4.  
but if your starting integer is like 47 and last is 57 it wont work. WHY. Could somebody please help me withit
May 6 '08 #1
Share this Question
Share on Google+
3 Replies


debasisdas
Expert 5K+
P: 8,127
just check all the over loaded Remove methods with their parameters , you will come to know the simple answer.
May 6 '08 #2

lotus18
100+
P: 866
Hi a simple questin in got is whythe remove thing doesent always work
if your starting integer is 0 and ending integer is like 10 its fine
Expand|Select|Wrap|Line Numbers
  1.  
  2. string =  textbox1.text.remove(0,10)
  3.  
  4.  
but if your starting integer is like 47 and last is 57 it wont work. WHY. Could somebody please help me withit
Hi

Expand|Select|Wrap|Line Numbers
  1.  string =  textbox1.text.remove(0,10)
  2.  
This means that 0 is your starting index to remove the characters and 10 is the length or the number of characters to be deleted.

Rey Sean
May 7 '08 #3

P: 20
you probably got it already from the replies above, whatever, your code will look like this
Expand|Select|Wrap|Line Numbers
  1. string=textbox1.text.remove(47,10)
  2.  
I presume you wanted to remove char.s with indices 47-57
the problem you're facing is caused by either the length of your textbox1.text is not 104(47+57) or even if it is, you're removing char.s with indices 47-104
May 8 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.