technology News
Showing posts about "from"
Remove HTML tags from string using regular expression - C#
Orignal Source:http://codingvilla.com/remove-html-tags-string-csharp-single-article-618.aspx#
HTML Tags:
Html has very simple and logical format. Html is a simple text and by using tags we can format this text, for example if we want bigger text, smaller text, bold text, underlined text etc. We use html tags for this purpose.
Syntax:
A less than sign '<' a word or character and greater than sign '>'
For example <p>, <title>
Remove HTML tags from string using regular expressions:
You can remove HTML tags from the strings. We remove these tags from the string to get plain text we just remove tags without changing in text.
To understand let us consider an example in which we have a string with HTML tags and text. To remove that tags we use namespace System.Text.RegularExpressions and use its class Regex which match the tags. And if the tags are matched then will we replace it by an empty string. To replace we use the ‘Replace’ method to replace the tags. In this way we can remove HTML tags from string using regular expressions.
To demonstrate make a console application and write the following code.
Code:
classRemove_HTML_tags_from_string
{
staticvoid Main(string[] args)
{
// sample text with tags
stringstr = "<html><head>I am a boy </head><body>I read in University</body></html>";
// regex which match tags
System.Text.RegularExpressions.Regexrx =newSystem.Text.RegularExpressions.Regex("<[^>]*>");
// replace all matches with empty string
str = rx.Replace(str, "");
Console.WriteLine(str);
Console.ReadLine();
}
}
Remove or delete elements from array in PHP
Orignal Source:http://codingvilla.com/remove-elements-array-php-single-article-575.aspx
Arrays:
Arrays are used to store data just like a variable; a variable store single data but arrays store multiple data. There are three types of array in php.
- Numeric Arrays
- Associative Arrays
- Multi-dimensional Arrays
Syntax:
$cars=array("Saab", “Volvo","BMW","Toyota"); //Numeric arrays
$ages = array("Peter"=>32, "Quagmire"=>30, "Joe"=>34); //Associative array
Remove array element in PHP:
To remove array element in php we use built in unset () function that was used for removing a variable in php. The unset () function takes element as a parameter and remove that element from array.
Code:
<?
$dogs = array('A' => 'C', 'B' => 'D','X' => 'Y', 'Q' => 'T');
printf("%s,", var_export($dogs, TRUE));
unset($dogs['X']);
printf("%s,", var_export($dogs, TRUE));
?>
Above is a simple code to remove an array element using unset () function in php.
This simple article tells that how we can remove an element from arrays in php.
How To Make Money Online From Blog
Orignal Source:http://codingvilla.com/make-money-online-blog-single-blogs-25.aspx
The term is effective as I read, surface of Blogs come into sight, adopting the concept of, efficient and economical technique to grab million of consumers.i research through many analysis report so just sharing my opinion regarding blog study among users or grown-up members in US. The ratio is about 58 million Americans, adults interpret blogs normally. You can pick the idea it is touching more than half American users.
So carefully read the blog to get good rank of your blog among users, it will also fulfill your desire to get familiar on internet blog world; parallel contain to make you richer too.
In my believe these are ten tips.
Examine and study:
What you want to publish? So according to those, do edify what can be most appropriate or what can be not. You can study and research to, about most fame full Blogs related to your. Do compare where you have space to fill or what can be adding better than others
.
Have deep concern on user or visitor remark in comment box. Take it positive all time, if he or she gave you zero point. All time try to evaluate the slip-up.
Domain name:
You can choose any good rank web for this purpose if you are feeling any hurdle to get any name or title.
Do visit to psychicwhois.com
Look for waiting you locate a domain name that you can adopt.
Here you can see the color sign that will let to study:
Green ones are open
Red ones are taken
Network:
Get interact and communicate with other blog holders and founders.
You will get mystify with latest information. You can easily access to blogosphere world.
Share knowledge what is new and latest arrivals
Craft Engaging Content:
Quality content is fundamental to the time of a blog. Interpret and explore latest and current topics.
Web hosting:
Get a domain name and web hosting package from Hostgator it is suggested by my side.
Head over to Hostgator and choose either the “Hatchling” or “Baby” plan.
Get certain to register the domain that you found in the first step
Next enter “ChristianPF” as a promo code and it will knock 25% off for you.
Is it easy to start a blog?
Cost to blog?
There are many armed forces that agree to you to start a blog for free.
You settle on you would like to join with it and that you would like to craft money with your blog. Anyone who is in actuality annoying to make money with a blog will most likely be more flourishing with a self-hosted blog.
You will want to disburse for nothing more than a domain name.
Getting a blogging platform:
Tumblr.com:
Simplest blogging platform to make use of but it also is the almost certainly the least customizable. So, it might be incredible good to found with, but it would be not easy to put up an income generating website with it.
Blogger.com:
It is also very good, simple to set up, owned by Google,
Do customize the theme, and the domain name includes “.blogspot.com
WordPress.com:
Most new bloggers like it much, as it is totally out of cost.
Effortless to set up, you can customize the theme, but other customizations are restricted, domain name includes “.wordpress.com”.
Get traffic to your blog:
Put some guest posts on your blog surface. What it can be? So letting you know it can be contain on some useful but much popular topic. It will read by your blog visitors. They can make points for your post by liking or disliking it. As we can say your post that is guest post can be admired or reject on the base of quality content, links if added. You can make your blog successful speedily by throwing your best articles there.
Sign up for blog societies:
Gets membership by signing up for these webs: mybloglog.com, technorati.com, and blogcatalog.com. Visit it frequently and say to its members to join your social network in blog world. And say them to be your friend for enhancing your linking concerns and relations. And this way they will visit you blog and automatically you will get more traffic.
Article submissions;
Put forward articles to article submission sites here are a few that are worth looking in
ezinearticles.com
goarticles.com
articledashboard.com
buzzle.com
articlecity.com
SEO:
Search Engine Optimization (SEO) is your loyal and keen concern tool. This gear all time wish to see your blog or web on top ranking list in search bar.
Title Tags:
Title is about what is user is looking on top of your blog. It is really very significant as you can’t even deny its vital worth. So work properly for this.
Keyword Research:
If you are trying to get traffic from search engines, it is forever a good design to be acquainted with what people are penetrating for before you start inscription. On which words, you are haunting by users on Google. Or for which keywords they are attaining you easily.
ADSENSE EARNINGS:
Added a Privacy Policy
Put ads where user view most in page side
Sees Ads Plugin
Plug-in that permits you to decide which companies see which ads. There is lots of criterion that you can decide on, so you are able to detail that Search Engine users see a fastidious Adsense unit when ordinary readers see something else.
Tools for more Aid:
Google Analytics:
Magnificent and free figures tool that will help you keep pathway of your visitors and analyze a lot of data about them.
Semiologic WP Theme:
It costs about $300 for the full version so if you are just starting out your probably don’t require the full report yet, but ultimately it is almost certainly worth bearing in mind
Google webmaster tools:
This will help you see how Google views your blog. They will as well let you know if there are any problems with it that you may not be aware of.
Aweber Email Marketing Service:
Google’s Keyword Tool
SEObook Keyword Tool
SocialPoster
Hittail.com
Stock.xchng
BigStock
Feedburner
Our most favorite search giant Google assign us too, some basic guide lines for is best blogger and get money about that:
So in Google guidelines it added:
Create a blog
Write a post
Add an image
Add a video
Privacy and permissions
Customizing your layout
Remove given String from string array in c#
Remove given String from string array in c#
String ArrayString Arrays are used to store more than one string. We create and declare string arrays like that:
string[] arr1 = new string[] { "one", "two", "three" };
String.Remove methodString.Remove method is used to delete a value which we want to remove from a given string array.
Removal of Specified String in String Array
We can remove a specified string in the string array by using String.remove method.
Code
using System.Collections;
using System.IO;
using System.Text.RegularExpressions;
class Program
{
static void Main(string[] args)
{
String[] array = { "1", "2", "3", "4", "5", "6" };
String hc = InputRemove("4", array);
if (hc.Equals(""))
{
Console.WriteLine("input String has Been Removed");
Console.ReadLine();
}
}
public static String InputRemove(string input, params String[] values)
{
string specified = input;
foreach (string removal in values)
{
int i;
while ((i = specified.IndexOf(removal)) > -1)
{
specified = specified.Remove(i, removal.Length);
}
}
return specified;
}
}
Generate hashcode from string array in C#
Generate hashcode from string array in C#
GetHashCode methodGetHashCode () is a method of object class and it is located in mscorlib assembly. It is used to generate hashcode from strings or even from bytes.String ArrayString Arrays are used to store more than one string. We create and declare string arrays like that:
string[] arr1 = new string[] { "one", "two", "three" };
Generating hashcode from a string arrayThe following code will demonstrate that how we can generate hashcode from string array
Code
using System;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Collections;
using System.IO;
usingSystem.Text.RegularExpressions;
class Program
{
static void Main(string[] args)
{
int hashcode = GenerateHashCode("A","B","C");
Console.WriteLine(hashcode);
Console.ReadLine();
}
public static int GenerateHashCode(params string[] values)
{
int hashcode = 0;
foreach (string value in values)
{
if (value != null)
hashcode += value.GetHashCode();
}
return hashcode;
}
}
Get Time from date in java
Get Time from Date in Java:In java if you want to Get time from date you have to use D ateFormat, ParseException and SimpleDateFormat. Make a class and pass a String, getTimefromDate is a method you will use, an exception will occur in some cases. Make a new object. “H” stands for hour, M stands for minutes and “S” stands for seconds.Here you have a simple code that will tell you how to get time from date in java:
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class Util{
public static String getTimeFromDate (Date date) throws ParseException
{
DateFormat formatter = new SimpleDateFormat("HH:mm:ss.SSS");
return formatter.format(date);
}
}
This is simple article that will tell you how to get Time from date in Java.
