• Post Reply Bookmark Topic Watch Topic
  • New Topic

substring a string in the reverse direction  RSS feed

 
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a string 1099647.

I need to substring this string from 7 to 4. Can this be done?
 
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's no single method call to do it, but you can just write a loop to append characters to a StringBuilder.
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can also do it as follows:



You may have to tweak your indices of 4 and 7 if this is not exactly what you want, but this should give you the idea.

Jeff
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!