So I have a string "SmartUserWantsToLive" I want to generate from it or any such string with capital letters strings like "Smart User Wants To Live". How do I do this?
Hello All,
I have a string as follows - MFMFMF
now i want to change this string to FMFMFM how to do this , help needed pls
i had tried
select replace(replace('mfmfmf','M','F'),'F','M')
this gives me result - MMMMMM
which i donot what
i want the output to be FMFMFM
Need your help
D.Mahesh
Hi,
I am not able to figure out which drivers should I use. Even I don't know what I have.
When I am trying to make the connection string through the .udl file it only shows SYbase ASE OleDB Provider
while in install folder I can see in driver list Syabse Ase ODBC driver but in connection string it is unable to pick up the driver, here I used Driver = (Sybase ASE ODBC Driver)
What should I go for?
Thanks
Hi,
I have a string literal as follows:
string filename = @"C:\myfolder\myfile.jpg";
When I use File.Exists(filename) it works most of the time but sometimes I get an error saying the following file doesn't exist:
C:myfoldermyfile.jpg
Something seems to strip the backslashes out of the filename. This code is sometimes accessed via an ajax request.
Does anyone know why/how this could be happening?
So, I have two types at the moment:
const unsigned char* unencrypted_data_char;
string unencrypted_data;
I'm attempting to perform a simple conversion of data from one to the other (string - const unsigned char*)
As a result, I have the following:
strcpy((unencrypted_data_char),(unencrypted_data.c_str()));
However, I'm receiving the error:
error C2664: 'strcpy' : cannot convert parameter 1 from 'const unsigned char *' to 'char *'
Any advise? I thought using reinterpret_cast would help, but it doesn't seem to make a difference.
Whatever string is given I have to see if there is exactly one space after and before =, If it is more than one space in either side I have to reduce that to one and if there is none, I have to insert one.
How should I do that ? String can contain anything.
Thanks
Hi,
I have an EF project which has embedded connection details.
Then when I use this project from a client library I get told to copy the config file across, which includes the connection details.
What are the rules re which connection string would be used here? i.e. does the database connection string in the client project override any connection strings in the EF library project?
I want to capture everything up to (not including) a # sign in a string. The # character may or may not be present (if it's not present, the whole string should be captured).
What would the RegEx and C# code for this by? I've tried: ([^#]+)(?:#) but it doesn't seem to work.
I have a string in lua.
It's a bunch of [a-zA-Z0-9]+ separated by a number (1 or more) spaces.
How do I take the string and split it into a table of strings?
Thanks!
This code give me an error:
string rus = "," + db_user.Anagrafica_Dipendente.ID_Dipendente + ",";
int i = db.CBR_User.Count(p => p.RiceviMail == true && ("," + p.Dipe + ",").Contains(rus))
p.Dipe is a string
how can i do that?
thanks
I have the date format string dd-mm-yy. Please can you tell me how to add hours and minutes to the string (i.e 13-03-2010.21.03) ....
DateTime.Today.ToString("dd-mm-yy") ?
If I have a string that looks like either
./A/B/c.d
OR
.\A\B\c.d
How do I get just the "./A/B/" part? The direction of the slashes can be the same as they are passed.
This problem kinda boils down to: How do I get the last of a specific character in a string?
Basically, I want the path of a file without the file part of it.
I want to create a TreeMap in Java with a custom sort order. The sorted keys which are string need to be sorted according to the second character. The values are also string.
Sample map:
Za,FOO
Ab,Bar
What methods are there to get JPQL to match similar strings?
By similar I mean:
Contains: search string is found within the string of the matches entity
Case-insensitive
Small mispellings: e.g. "arow" matches "arrow"
I suspect the first two will be easy, however, I would appreciate help with the last one
Thank you
Given a url, and a query string, how can I get the url resulting from the combination of the query string with the url?
I'm looking for functionality similar to .htaccess's qsa. I realize this would be fairly trivial to implement completely by hand, however are there built-in functions that deal with query strings which could either simplify or completely solve this?
Example input/result sets:
Url="http://www.example.com/index.php/page?a=1"
QS ="?b=2"
Result="http://www.example.com/index.php/page?a=1&b=2"
-
Url="page.php"
QS ="?b=2"
Result="page.php?b=2"
How can I assign this string in a Java String?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
thanks
How do I convert the value of a PHP variable to string? I was looking for something better than concatenating with an empty string:
$myText = $myVar . '';
like the ToString() method in Java or .NET.
Hi,
How can i extricate substring from string using powershell ?
I have this string: "-----start-------Hello World------end-------", i have to the hello world.
What is the best way to do that?
Thanks!
Simple example: we have string "Some sample string Of Text". And I want to filter out all stop words (i.e. "some" and "of") but I don't want to change letter case of other words which should be retained.
If letter case was unimportant I would do this:
str.toLowerCase().replaceAll ("a|the|of|some|any", "");
Is there an "ignore case" solution with regular expressions in java?
hi
i want to know how to get correct word from wrong one...
example
The string is "sstring"
but the correct word is string...
is any algorithm in php?
thanks and advance
So here's the deal I'm working on a project that requires me to have a 2 dimensional arraylist of 1 dimensional arrays. But every time I try to load in my data I get an error:
Can't do this opperation because of bad input
java.lang.IndexOutOfBoundsException: Index: 1, Size: 0
On some of the inputs. I've got no idea where I'm going wrong on this one. A little help please?
Source Code:
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
import javax.swing.JOptionPane;
import java.io.InputStream;
public class Facebull
{
public static void main (String[] args) {
if(args.length != 0){
load(args[0]);
}
else{
load("testFile");
}
}
public static void load(String fname) {
int costOfMach = 0;
ArrayList <Integer> finalMach = new ArrayList<Integer>();
ArrayList <ArrayList<int[]>>machines = new ArrayList<ArrayList<int[]>>();
Scanner inputFile = null;
File f = new File(fname);
if (f.exists ())
{
try
{
inputFile = new Scanner (f);
}
catch (FileNotFoundException e)
{
JOptionPane.showMessageDialog(null,"Can't find the file\n" + e);
}
int i = 0;
while (inputFile.hasNext ( ))
{
String str = inputFile.nextLine ( );
String [ ] fields = str.split ("[\t ]");
System.out.println(str);
if (!(fields[0].isEmpty() || fields[0].equals (""))){
fields[0] = fields[0].substring(1);
fields[1] = fields[1].substring(1);
fields[2] = fields[2].substring(1);
try
{
//data to be inputed is 0 and 3 location of data is 1 and 2
int[] item = new int[2];
item[1] = Integer.parseInt(fields[0]);
item[0] = Integer.parseInt(fields[3]);
if(machines.size() < Integer.parseInt(fields[1])){
ArrayList<int[]> column = new ArrayList<int[]>();
machines.add (Integer.parseInt(fields[1])-1, column);
System.out.println("we're in the if");
}
machines.get(Integer.parseInt(fields[1])-1).add(Integer.parseInt(fields[2])-1, item);
}
//catches any exception
catch (Exception e)
{
System.out.println("Can't do this opperation because of bad input \n" + e);
}
}
}
inputFile.close ( );
}
System.out.print(machines);
}//end load
}
@string = "Sometimes some stupid people say some stupid words"
@string.enclose_in_brackets("some") # => "Sometimes {some} stupid people say {some} stupid words"
How should the method enclose_in_brackets look ? Please keep in mind, I want only enclose whole words, (I don't want "{Some}times {some} stupid....", the "sometimes" word should be left unchanged
Looking at the information under the heading "Precision can be omitted or be any of:".
The example: printf("%.*s", 3, "abcdef"); works, outputting:abc (truncating the rest of the string.)
Now, I would like to have a string with multiple parameters formatted (truncated):
printf("%.*s, %.*s", 3, 3, "abcdef", "xyz123");
but the program crashes.
What is the correct syntax?
Thank You.