How To Replace A Character In A String To Space Or White-space
May 5, 2010How to replace a character in a String to space or white-space?
View 3 RepliesHow to replace a character in a String to space or white-space?
View 3 RepliesIn my website, users have the ability to upload images to my website. When the image is uploaded it will automatically have a smaller thumbnail created by my website. The thumbnails are not displaying correctly in my repeater though (and by correctly I mean Im not sure how to display them).
Each image sits inside a square div element which is 145 x 145 pixels. Some of the images are 145 wide with a relative height and some are 145 high with a relative width. When my page is displayed the wider images sit at the bottom of my 145 x 145 div,whereas the higher image sit at the bottom and to the left. I would prefer them to all be centered.
I cant find a way to do this is in CSS becuase the images are retrieved dynamically so I cant assign a height beforehand. Is there a way to add white space to my image during the thumbnail creation process so that all images are 145 x 145 but still maintain the aspect ratio? Or can someone think of a good way to do this with CSS and HTML, OR even with javascript (keeping in mind that my images come inside a repeater bound to data in the db.
If you want to see any of my code or the thumbnail creating class just ask.
I'm trying to remove all white or transparent pixels from an image, leaving the actual image (cropped). I've tried a few solutions, but none seem to work. Any suggestions or am I going to spend the night writing image cropping code?
View 4 RepliesI want to be able to show as below in asp.net using vb
Warehouse
Purchasing
System
I am using labels for the above three words. Is there a way to do it.
when i create a chart, it renders with lots of white space around the actual chart itself, especially below the legend. how can i adjust this?
View 3 RepliesIn my ASP.NET application, I was trying to add few white spaces between two text boxes by typing space bar. The equivalent HTML source was instead of . So I just wanted to check: is this the new replacement for white space? If yes, why they changed?
View 3 RepliesFor some reason, the 20px button wraps around to the next line even though the div is 500 pixels wide.What am I doing wrong?
[Code]....
i m using vs2005 for development
i haev desing a one web page with size ( 15 k) now i want to remove the white space and make it in one single line .
let's say I have the following string:
string s = "A B C D TESTTEST BLA BLA TEST TEST2"
Then I need the following:
"A B C D TESTTEST BLA BLA TEST TEST2"
So the rules are:a) replace every second space (between non space chars) with
b) If the last space is replaced with , try to move it backwards (if possible) one step so the next word is not touched by the force space.
Background:I want to use that to print data from the database to my website. But I want to optimize the forced spaces to use less space. I also want the last forced space not to touch the next word (if possible) so it is easier for some search engines to catch that word.
Will I need to loop through every char in that string and count the occurrence or is there an easier, faster and more fancy way?]So I did a benchmark to figure out which solution to accept:
@Guffa, your solution needs 22 seconds for 1 Million runs
@Timwi, your solution needs 7 seconds for 1 Million runs
I will give you both an upvote, but I will accept Timwi's solution.
I have a page with several asp labels with no text. I use a click event to add text the fields that have related values from a datareader. In my code I state that if column value of the datareader is null, then make the label visibility false.
[code]....
That all works fine, but then when I render the page, white space where the hidden labels are located is shown.is it possible to remove the blank white space when labels have null values and are visually hidden?
I found an useful link which show tutorial for setup Gridview export to Excel.http://archive.aspsnippets.com/post/Export-GridView-To-WordExcelPDFCSV-in-ASPNet.aspxIt works well but if I want to preserve white space for certain boundfield, after the excel export, I got merged cell for every row. how do I avoid the merged cells?
[Code]....
I am currently working on an invoice report which may or may not span across multiple pages. I have a header which I have setup to only be displayed on the first page, and a footer which I have setup to only be displayed on the last page. The problem is, the hidden header/footer reserves unwanted whitespace and messes up the report layout (see the screenshot). The black areas represent space that is reserved by the header/footer. There must be a simple way to remove this unwanted space.
View 2 Repliesi have a column in table and need to combine words seperated by single space, i am using sql server 2005.
DECLARE @text varchar(256)
SELECT @text = 'Micro Tech'
--required output MicroTech
I am having problems with rendering differences between a gridview control and a local report .rdlc rendering. The dataset shows different spacing between characters in the dataset visualizer than it does in the gridview. The sql reporting services report is more closely rendering what is shown in the visualizer. The dataset is filled From a DAL and then bound to the gridview and reporting service at runtime. I'm currently using VS2008 and programming in VB.
View 6 Repliesi'm writing a stored proc and if a field i return is longer then 200 characters, i want to truncate, find the last space, remove any characters after that space, then add some full stopseg:
INSERT INTO @rec(articleid, abstract)
SELECT a.id,
CASE
[code]...
I have an asp.net regularexpressionvalidator that I need to match on a textbox. If there is any text, logically the rules are as follows:
The text must be at least three characters, after any trimming to remove spaces.
Characters allowed are a-zA-Z0-9-' /&.
I'm having major pain trying to construct an expression that will allow a space as the thrid character only if there is a fourth non-space character.
My last attempt was:
^[a-zA-Z0-9-'/\&.](([a-zA-Z0-9-'/\&.][a-zA-Z0-9-' /\&.])|([a-zA-Z0-9-' /\&.][a-zA-Z0-9-'/\&.]))[a-zA-Z0-9-' /\&.]{0,}$
but that does not match on 'a a'.
I'm using to replace space with background color in my editor. txt1.text = " ";
This displays output as text instead of adding empty space.
If i use " " which in return shows empty space with no padding and no margin almost invisible with no background color. I want to add so that I can see proper space with background color.
I would like to have an regular expression that does not allow any spaces(before,within,after the word) and alphanumeric characters.
View 3 RepliesI am trying to replace all null value with space for all columns in a table.
(note: just we have to pass parameter table name "XYZ" result will come aotumaticly, we dont need to bother about column name)
i have done it through C# application. but love to do it through Sqlserver only like using storeprocedure, function.
my C# code is like that
[code]....
How to remove whitespaces if it is more than 2. What i want to say is -
1. If there is one whitespace, its OK.
2. If there is two whitespace, its OK.
3. BUT, if there is more than two whitespace than replace them with only two whitespaces.
String may be like this :- (it may contain any character)
DuntaviDilaniyd.dilaniy@woridnitattnit 15 jim alixandir id PALESTINE TX
48568 2470325837 US FEMALESunday, April 09, 1939 162 170 A+ • Duntavia
Delaney Jon Muller Sherman TX 84321 US 9974766226 NO NO YES
[CODE]..
I have a [URL]...... When I click on Like tweet then it is changed into [URL] ...... Except Tweet Like i have no problem. In others it is changed into [URL] ..... So i don't have any problem. For Twitter Like I am using this Code:
<a href="https://twitter.com/share" class="twitter-share-button">Tweet</a>
<script language="javascript" type="text/javascript">
!function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (!d.getElementById(id)) {
js = d.createElement(s);
js.id = id; js.src = "//platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js, fjs); } }
(document, "script", "twitter-wjs");</script>
I have done URL Routing:
System.Web.Routing.RouteTable.Routes.MapPageRoute("View Catalogues", "Colors/View Catalogues", "~/ViewCatalogues.aspx");
The table cells on the List.aspx all have an inline CSS style that prevents the text from wrapping. Sometimes I want the cells to wrap. How do I prevent the inline CSS from appearing?
[Code]....
I have a problem with DataSet.GetXml() in ASP.NET 4.0:
First I populate the dataset with some tables.
Then I run the .GetXml() method on the dataset and some XML is returned. The output of this method is not want I want it to be, however.
The desired result is this:
[code]....
How do I stop this from happening? I mean, how do I stop the cell from being included at all?
In ASP.NET 1.1 the same code is used and the desired output is returned. This means that it is probably some new thing in 4.0 that I have to switch on/off. But what?
DateTime.Now.ToString("h:mm tt")
What is the proper way to.. escape if that is the proper term, that html entity so that it will produce the output Code: 8:53 am and the non breaking space is rendered correctly be the browser?
if a string
(1)Hello
than output 0 space
(2)Hello
than 5 space found