Click here to Skip to main content
15,868,141 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have string like str4 i want to remove str and store only 4 into database. value limit is 1 to 255 it means it can be str5 or str 222. please help me i am using mvc with razor.
Posted
Updated 21-Jul-14 20:22pm
v3

use like this
String s = "str4";

int StartIndex = s.length;

if(StartIndex > 3)
{
    String value = s.Substring(3);
}
 
Share this answer
 
v2
Hi,

use Substring method to get the value.
 
Share this answer
 
v2
Comments
Member 9027346 22-Jul-14 2:35am    
but value limit is 1 to 255
C#
string sub = input.Substring(3);

this will assigns the substring value after 3 chars to sub
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900