Click here to Skip to main content
15,886,857 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I'm trying to if 6 Conservative spaces are occurred in text then it con cat in single line?
e.g

a) In the name(s)............................and ............................
b) In the case of minor, his date of birth........................

encashable by the minor's parent/guardian Shri/Smt ..........
c) Agent's name ...................................
d) Certificate of Authority No..........................

I want as follow:-
a) In the name(s)............................and ............................
b) In the case of minor, his date of birth........................encashable by the minor's parent/guardian Shri/Smt ..........
c) Agent's name ...................................
d) Certificate of Authority No..........................
Posted
Updated 26-Mar-15 19:18pm
v2
Comments
Afzaal Ahmad Zeeshan 27-Mar-15 0:50am    
6 consecutive spaces, or 6 total spaces? 6 spaces in words or 6 spaces in characters. There is a lot of information that you have not yet provided.

Please improve the question to get a good answer.
Sergey Alexandrovich Kryukov 27-Mar-15 1:40am    
Before you dig into the information which is not yet provided, just look at it at some distance. Don't you see the super-puper abuse in it? Not even ASP.NET abuse, but the abuse of the civilization.
Will you look at my answer, Solution 1?
—SA
Member 11466475 27-Mar-15 0:57am    
6 consecutive spaces.
_Maxxx_ 27-Mar-15 1:35am    
I don't follow you?
Are you saying that the date of birth area has 6 spaces, so you want to force the 'encashable' line to be on the same row?
You mean 'exactly' 6 spaces? Not more nor less?

I think we would need to know where this text is appearing, to give an answer. e.g. if it is on a web page in html, then what is currently causing it to wrap to the next line? Unless there is some tag forcing the line break (for example, <br> or <p>) then it will just be wrapping according to available space on the page.

1 solution

Don't do ugly stuff inherited from the texts created for the blanks on a historical mechanical typewriter. Use TextBox, which is implemented as the text <input> element:
https://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.textbox%28v=vs.110%29.aspx[^].

Also note that for all non-ugly fonts, the number of characters (spacer or not), it pretty much irrelevant, because they are not monospace, different texts with the same number of characters take different space.

—SA
 
Share this answer
 
v2
Comments
Afzaal Ahmad Zeeshan 27-Mar-15 4:37am    
+5, although OP himself didn't have any idea for what he wanted, if there are spaces no matter 6 or 7, the line is already being concatenated.
Sergey Alexandrovich Kryukov 27-Mar-15 11:16am    
Probably you are right.
Thank you, Afzaal.
—SA

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