C# in Windows Application
-
Hi ALL, retrieving a string from database like this 1. MAKARAMPURAM, MAKARAMPURAM, 2. SALINA PUTTUGA, SALINA PUTTUGA, 3. MAKARAMPURAM, MAKARAMPURAM, 4. MAKARAMPURAM, JANNI PUTTUGA, 5. MAKARAMPURAM, MAKARAMPURAM, 6. KORIKANA PUTTUGA, KORIKANA PUTTUGA, 7. MAKARAMPURAM, MAKARAMPURAM Now i have to display this entire string to label,in the form of 3 or 4 lines is it possible? could anyone help me how to split this string Thanks Nath
-
Hi ALL, retrieving a string from database like this 1. MAKARAMPURAM, MAKARAMPURAM, 2. SALINA PUTTUGA, SALINA PUTTUGA, 3. MAKARAMPURAM, MAKARAMPURAM, 4. MAKARAMPURAM, JANNI PUTTUGA, 5. MAKARAMPURAM, MAKARAMPURAM, 6. KORIKANA PUTTUGA, KORIKANA PUTTUGA, 7. MAKARAMPURAM, MAKARAMPURAM Now i have to display this entire string to label,in the form of 3 or 4 lines is it possible? could anyone help me how to split this string Thanks Nath
Nath wrote:
Now i have to display this entire string to label,in the form of 3 or 4 lines is it possible? could anyone help me how to split this string
If you really mean splitting, have a look at String.Split method. if you just want to show that on several lines and control the line breaks you could add new lines before the ordinal numbers.
The need to optimize rises from a bad design.My articles[^]
-
Hi ALL, retrieving a string from database like this 1. MAKARAMPURAM, MAKARAMPURAM, 2. SALINA PUTTUGA, SALINA PUTTUGA, 3. MAKARAMPURAM, MAKARAMPURAM, 4. MAKARAMPURAM, JANNI PUTTUGA, 5. MAKARAMPURAM, MAKARAMPURAM, 6. KORIKANA PUTTUGA, KORIKANA PUTTUGA, 7. MAKARAMPURAM, MAKARAMPURAM Now i have to display this entire string to label,in the form of 3 or 4 lines is it possible? could anyone help me how to split this string Thanks Nath
Will the length and pattern of the string remain same? If not, then you cannot assure that the string can be shown in 3-4 lines. If it remains same, you can get three equal length substrings from the string. (There is a lot of chance that the substring will be illogically formed.) Or, split the string over numbers(provided pattern remains same) and join the consecutive parts till the total length becomes about 1/4th of the original string.
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."