<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<%
string sMetin="Herhangi bir metinde geçen kelimenin kaçıncı karakter olduğunu bulma.";
int i = sMetin.IndexOf("kaçıncı"); //metnin kaçıncı karakter olduğunu sorgular
%>
<%=i %>
</body>
</html>
-----------------------------------------------------------------------------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<%
string sMetin = "elimde bulunan bir metinin üzerine";
string sMetin2 = ", dışarıdan aldığım yeni metni ekleme.";
sMetin = sMetin.Insert(sMetin.Length, sMetin2); // smetin sayarak ve onun uzunluğundan sonra smetin2 yi ekler
%>
<%=sMetin %>
</body>
</html>
--------------------------------------------------------------------------------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<%
string sMetin = "bir sabah, alıp seni benden gitti bu diyardan";
sMetin += ", hazin bir mektup, bir-yadiğar kalan";
sMetin = sMetin.Remove(45, 37);//metindeki karakterleri istenen karakterden itibaren istenilen kadar silme işlemi yapar.
%>
<%=sMetin %>
</body>
</html>
--------------------------------------------------------------------------------------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<%
string sMetin = " bir sabah, alıp seni benden gitti bu diyardan#";
sMetin = sMetin.Trim();
Response.Write("Boşluklar temizlendi : " + sMetin + "<br>");
sMetin = sMetin.Trim('#');
Response.Write("Belirlenen karakterler temizlendi : " + sMetin + "<br>");
%>
</body>
</html>
-----------------------------------------------------------------------------------------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<%
int i;
for(i=1; i<=100; i++)
{
Response.Write("Ray ETKİN" +"<br>");
}
%>
</body>
</html>
------------------------------------------------------------------------------------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<%
string isim = "RAY ETKİN";
for (int i = 0; i < isim.Length+1 ; i++)
{
Response.Write(isim.Substring(0, i) + "<br>");
}
for (int i = 0; i < isim.Length ; i++)
{
Response.Write(isim.Substring(i, 1) + "<br>");
}
// for (int i = isim.Length ; i >0; i--)
//{
// Response.Write(isim.Substring(i, 1) + "<br>");
//}
%>
</body>
</html>
----------------------------------------------------------------------------------------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<%
int i = 0;
while (i < 100)
{
Response.Write("ray etkin"+ "<br>");
i++;
}
%>
</body>
</html>
28 Ocak 2009 Çarşamba
Bazı notlar
Kaydol:
Kayıt Yorumları (Atom)
Hiç yorum yok:
Yorum Gönder