473,387 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

About selection of first 10 characters

i have a series like
case 1) AS123-6889-98 ---
case 2) CDGH-4564-4569887

1)Now it should select first 10 characters including special characters
2)Now it should select till (CDGH-4564)
it should select till -
same code should be there for both.
Sep 3 '14 #1
2 1184
IronRazer
83 64KB
Hi,
You can use the String.Remove method to do this.

Expand|Select|Wrap|Line Numbers
  1.         Dim str As String = "CDGH-4564-4569887"
  2.         str = str.Remove(9) 'removes all characters after the 9th character
  3.         MessageBox.Show(str) 'displays "CDGH-4564"
  4.  
msdn link to the String.Remove method.
http://msdn.microsoft.com/en-us/libr...vs.110%29.aspx
Sep 3 '14 #2
Frinavale
9,735 Expert Mod 8TB
Please checkout the topic of Regular Expressions.


Here are some resources to get you started:
-Frinny
Sep 16 '14 #3

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

Similar topics

9
by: Safalra | last post by:
The idea here is relatively simple: a java program (I'm using JDK1.4 if that makes a difference) that loads an HTML file, removes invalid characters (or replaces them in the case of common ones...
0
by: Anders Both | last post by:
If some no standard character are submitted to the server, the are submitted in the escaped form . Eg like this: %u0644%u064A%20%u0626%u064A%u0646%u062A%u0629 (some arabic text) I want to put...
0
by: aPRSComp | last post by:
Hi, Has anyone seen where using SELECT * truncates characters ? mysql> SELECT * FROM countries; +-------------+-----------+ | country | capital | +-------------+-----------+...
0
by: .Net Sports | last post by:
I've been looking everywhere, but i can't locate any functions, or articles on the net or my resources, on how to open a file using vb.net, and then grabbing certain parts of the file, and putting...
9
by: Henrootje | last post by:
Hello all, I have a problem that is alike others I have seen but I am not able to apply the solutions I saw using Trim, Left, Right and so on. That is why I ask here. What is the case? I...
1
by: David Stone | last post by:
I have a table class that I would like to add specific td and th styles to. I can do this: table.mytable { ... } table.mytable th { ... } table.mytable td { ... } but the th and td are...
3
by: js | last post by:
>>print u"äöü" äöü Python seems to treat non-ASCII chars in a list differently from the one in the outside of a list. I think this behavior is so inconvenient and actually makes debugging...
0
by: jeelansja | last post by:
Hi I am working on db2/aix64 8.2.1 with mainframe ,i have a file in mainframe with special charcters in it for ex india with special charcters japanese char when i ftp into the unix box it...
8
by: danon | last post by:
Hi evrey one needing you're hlp please can any one tel me how to programme a first characters uppercase in textbox thank you
21
by: Yoni Hasid | last post by:
Hello, I am trying to match tables into a query based on 5 first characters in one field. I used expression: =left(), 5) however it does not return matched entries as I needed. Basically, I need to...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.